This file contains hidden or 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
ssd1306 on SPI bus: | |
# Raspberry Pi pin configuration: | |
RST = 19 | |
# Note the following are only used with SPI: | |
DC = 16 | |
bus = 0 | |
device = 0 | |
# 128x64 display with hardware SPI: | |
disp = SSD1306.SSD1306(RST, DC, SPI.SpiDev(bus,device)) |
This file contains hidden or 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
#include <FastLED.h> | |
#define piezoPin 3 | |
#define LED_PIN 4 | |
#define NUM_LEDS 15 | |
#define BRIGHTNESS 25 | |
#define LED_TYPE WS2811 | |
#define COLOR_ORDER GRB | |
CRGB leds[NUM_LEDS]; |
This file contains hidden or 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
radio.onReceivedString(function (receivedString) { | |
basic.showString(receivedString) | |
}) | |
input.onButtonPressed(Button.A, function () { | |
radio.sendString("" + control.deviceSerialNumber()) | |
}) | |
let message = "" | |
basic.showString("ok") | |
serial.redirectToUSB() | |
radio.setGroup(11) |
This file contains hidden or 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
radio.onReceivedString(function (receivedString) { | |
basic.showString(receivedString) | |
}) | |
input.onButtonPressed(Button.A, function () { | |
radio.sendString("" + control.deviceSerialNumber()) | |
}) | |
let message = "" | |
basic.showString("ok") | |
serial.redirectToUSB() | |
radio.setGroup(11) |
This file contains hidden or 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 python3 | |
# sudo apt install python3-bs4 | |
# curl -d 'sessionid=123&encses=456' https://skyward.alpinedistrict.org/scripts/wsisa.dll/WService=wsEAplus/sfgradebook001.w | ./missing-assignments.py >/dev/ttyACM0 | |
from bs4 import BeautifulSoup | |
import sys | |
import time | |
soup = BeautifulSoup(sys.stdin.read(), 'html.parser') |
This file contains hidden or 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
# sudo su | |
sudo apt install dnsmasq -y | |
echo “dtoverlay=dwc2” >> /boot/config.txt | |
# Edit /boot/cmdline.txt and after rootwait, add: | |
modules-load=dwc2,g_ether | |
cat >/etc/network/interfaces.d/usb0 <<EOF | |
auto usb0 |
This file contains hidden or 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/python | |
# Display host and IP on the "LCD RGB KEYPAD For RPi" | |
# invoke with hostname and ip address | |
# displaynet.py `hostname` `hostname -I` | |
# using deprecated Adafruit_CharLCD | |
# I don't know why Backpack has to be used to light the backlight | |
# Plate turns on the LED that is not part of the display | |
import sys |
This file contains hidden or 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 os | |
import time | |
from PIL import Image | |
from luma.core.interface.serial import spi | |
from luma.oled.device import ssd1306 | |
serial = spi(device=0, port=0, gpio_DC=16, gpio_RST=19) # luma defaults are gpio_DC=24, gpio_RST=25 | |
device = ssd1306(serial) | |
image = Image.open(os.path.dirname(os.path.realpath(__file__)) +"/pioneer600.bmp").convert('1') | |
device.display(image) |
This file contains hidden or 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
let reversing = 0 | |
let pitch = 0 | |
let roll = 0 | |
radio.onReceivedValue(function (name, value) { | |
if (name == "roll") { | |
roll = value / 50 | |
} else if (name == "pitch") { | |
pitch = (0 - value) / 50 | |
} | |
if (pitch > 0) { |
This file contains hidden or 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
let sprite3: game.LedSprite = null | |
let sprite2: game.LedSprite = null | |
let sprite1: game.LedSprite = null | |
input.onButtonPressed(Button.B, function () { | |
sprite1.move(1) | |
radio.sendValue("movedto", sprite1.get(LedSpriteProperty.X)) | |
}) | |
input.onButtonPressed(Button.A, function () { | |
sprite1.move(-1) | |
radio.sendValue("movedto", sprite1.get(LedSpriteProperty.X)) |