Skip to content

Instantly share code, notes, and snippets.

View javaplus's full-sized avatar

Barry javaplus

  • N/A
  • Southern Ohio
View GitHub Profile
@javaplus
javaplus / simpleCountDown7SegmentArduino.ino
Created November 9, 2019 00:15
Simple countdown for Arduino using 7 segment display with HT16K33 backpack
#include <Wire.h> // Enable this line if using Arduino Uno, Mega, etc.
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"
Adafruit_7segment matrix = Adafruit_7segment();
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("7 Segment Backpack Test");
@javaplus
javaplus / servo-control.py
Created October 21, 2019 19:32
RaspberryPi Simple Servo Example
# Servo Control
import time
import wiringpi
def moveToDegree(degrees):
wiringpi.pwmWrite(18, degrees)
# https://learn.adafruit.com/adafruits-raspberry-pi-lesson-8-using-a-servo-motor/servo-motors
@javaplus
javaplus / pwm.py
Last active August 4, 2025 06:05
RaspberryPI BTS7960 HBridge Example Simple
###############################################################
## Simple code to use PWM on the PI to control the BTS7960
##
## This simply spins the motor in one direction slowly
## speeding up slowly and then slowing down slowly over
## and over again.
##
###############################################################
import RPi.GPIO as GPIO
@javaplus
javaplus / SimpleHBridgeTest.ino
Created October 19, 2019 17:21
Simple Arduino Code to Demonstrate using BTS7960 HBridge to Control Motor
/*......................
* BTS7960 HBridge Test
*
* Simple example of using the BTS7960 HBridge to control a motor
* This sketch simply sends a pwm signal to the HBridge to spin the motor
* one way and then spin the motor the other direction.
*
* PWM Description for Arduino: https://www.arduino.cc/en/tutorial/PWM
*
* By : Barry Tarlton