This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import explorerhat | |
import time | |
steps = [0 for x in range(16)] | |
G_FORWARDS = 2 | |
G_BACKWARDS = 3 | |
G_LEFT = 1 | |
G_RIGHT = 4 | |
G_PLAY = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
You will need: | |
* Explorer HAT Pro | |
* Makey Makey | |
* STS-Pi | |
* A USB battery | |
Note: You will probably need to grab the latest pyusb from GitHub to make this work: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
x=x\ | |
=begin = 1 | |
print("Hello World, I'm Python!") | |
''' | |
=end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from blinkt import set_pixel, clear, show | |
from time import localtime, sleep | |
MODE_HOUR = 0 | |
MODE_MIN = 1 | |
MODE_SEC = 2 | |
time_to_stay_in_mode = 3 | |
time_in_mode = 0 | |
mode = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In /etc/network/interfaces | |
iface usb0 inet static | |
dns-nameservers 8.8.8.8 8.8.4.4 | |
address 10.0.16.16 | |
netmask 255.255.0.0 | |
gateway 10.0.16.32 | |
# In /etc/dhcpcd.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# NOTE! This file replaces __init__.py in the Unicorn HAT HD library and allows it to drive two displays side-by-side, | |
# in this configuration: https://twitter.com/Gadgetoid/status/883259931478155264 | |
# Both HATs are connected to Mini Black HAT Hack3r boards- the right board is connected directly to the Pi, and the left | |
# board is wired to the GPIO outputs of the right using the standard UHHD pinout: https://pinout.xyz/pinout/unicorn_hat_hd | |
# MISO is not needed, and the chip-select pin is jumped from BCM7 on the right header to BCM8 on the left. |
OlderNewer