Skip to content

Instantly share code, notes, and snippets.

View Gadgetoid's full-sized avatar
🚼
+1 Baby

Philip Howard Gadgetoid

🚼
+1 Baby
View GitHub Profile
@Gadgetoid
Gadgetoid / ExplorerHat.md
Last active May 31, 2018 22:45
Explorer HAT, Motors, Steppers and Servos

#Explorer HAT Pro, Motors, Servos and Steppers

Find this Gist at: tiny.cc/explorerhat

The Motor driver on Explorer HAT Pro can not only drive motors, but a stepper motor too. And just like the Pibrella the outputs can also drive a motor or four, or another stepper.

Explorer HATs outputs sink to ground, meaning that you need to connect whatever you're driving between 5V and the output

#MOTORS

@Gadgetoid
Gadgetoid / touch-to-output.py
Created June 5, 2015 11:49
Toggle Explorer HAT's LEDs and outputs using the cap touch buttons
import explorerhat
import signal
def toggle_output(channel, event):
print("Got {} on channel {}".format(event, channel))
if channel < 5:
explorerhat.light[channel-1].write(event=='press')
explorerhat.output[channel-1].write(event=='press')
explorerhat.touch.pressed(toggle_output)
gadgetoid@superdupercomputer > ./generate-defines.py explorer-hat-pro wiringpi c
// Pin definitions for Explorer HAT Pro
// Using the wiringpi pin numbering scheme
#define EXPLORER_HAT_PRO_ADDR_ANALOG_INPUT 0x48
#define EXPLORER_HAT_PRO_ADDR_CAP_TOUCH 0x28
#define EXPLORER_HAT_PRO_CE0 10
#define EXPLORER_HAT_PRO_MISO 13
#define EXPLORER_HAT_PRO_INPUT_4 6
#define EXPLORER_HAT_PRO_SCKL 14
#define EXPLORER_HAT_PRO_LED_4 21
@Gadgetoid
Gadgetoid / WiringPi2-Python PiGlow Tests
Created August 16, 2013 10:20
Various patterns, cross fades, fades and helpful functions for PiGlow. Hopefully to be implemented into WiringPi2-Python.
import wiringpi2 as wiringpi
from math import floor
io = wiringpi.GPIO(wiringpi.GPIO.WPI_MODE_PINS)
wiringpi.piGlowSetup(1)
def toggleAll(led,intensity):
wiringpi.piGlowLeg(0,intensity)
wiringpi.piGlowLeg(1,intensity)
wiringpi.piGlowLeg(2,intensity)
@Gadgetoid
Gadgetoid / dabblet.css
Created July 5, 2013 09:22 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.avg-navigation {
margin:0;padding:0;list-style:none;
background:#171922;
display:block;
width:830px;
height:130px;
position:relative;