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
void setup() { | |
// put your setup code here, to run once: | |
pinMode(15, OUTPUT); | |
pinMode(14, OUTPUT); | |
tone(15, 40); | |
tone(14, 40); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: |
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 python | |
# pip install Adafruit-GPIO Adafruit-PureIO Adafruit-SSD1306 | |
import time | |
import Adafruit_GPIO.SPI as SPI | |
import Adafruit_SSD1306 | |
from PIL import Image | |
RST = 24 | |
DC = 23 | |
SPI_PORT = 0 | |
SPI_DEVICE = 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
#!/usr/bin/env python | |
import io | |
import time | |
import picamera | |
import Adafruit_SSD1306 | |
from Adafruit_GPIO import SPI | |
from PIL import Image | |
RST = 24 |
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 | |
import cv2 | |
import io | |
import time | |
import picamera | |
import Adafruit_SSD1306 | |
import numpy as np | |
from Adafruit_GPIO import SPI | |
from PIL import 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
#!/usr/bin/env python3 | |
# sudo apt install build-essential python3-dev python3-pip libhdf5-100 libcblas3 libatlas3-base libjasper1 | |
# pip3 install picamera opencv-contrib-python-headless luma.oled | |
import cv2 | |
import io | |
import time | |
import math | |
from picamera import PiCamera |
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)) |
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
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
#!/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
# 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 |