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 time | |
uart = busio.UART(rx=board.SLOT2.FAST2, tx=board.SLOT2.FAST1, baudrate=115200, bits=8, parity=None, stop=1 ) | |
buffer=bytearray(31) | |
error_flag = False | |
while True: | |
c=uart.read(1) | |
#time.sleep(0.005) |
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
// CAN readout of VW type 5 modules | |
// ------- Programa adaptado por Alfonso para comunicar las celdas SDI de VW a 15-04-2022 | |
// ------- Funciona con un Arduino nano, y el MCP2515, la interrupción del integrado interrumpe algunos comandos, pero en general va respondiendo con 1 módulo solo conectado. | |
// | |
// ------- Program adapted by Alfonso to communicate VW SDI cells to 04-15-2022 | |
// ------- It works with an Arduino nano, and the MCP2515, the IC interrupt interrupts some commands, but in general it responds with only 1 module connected. | |
// | |
// | |
// | |
// Link información muy útil: https://openinverter.org/wiki/VW_Hybrid_Battery_Packs |
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
# cheerlights | |
from time import sleep | |
from galactic import GalacticUnicorn | |
from picographics import PicoGraphics, DISPLAY_GALACTIC_UNICORN as DISPLAY | |
# setup graphics | |
gu = GalacticUnicorn() | |
graphics = PicoGraphics(DISPLAY) |
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
""" | |
KMK keyboard for Pimoroni Keybow. | |
WARNING: This doesn't currently function correctly on the Raspberry Pi Zero, | |
some of the keys are stuck in the 'pressed' position. There's either a bug in | |
the keypad implementation on the rpi0, or the pin numbers don't match the pins | |
in linux. | |
This is a 4x3 macro pad designed to fit the rpi's GPIO connector. Each key is | |
attached to a single GPIO and has an APA102 LED mounted underneath it. |
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
# based on example code from Adafruit and dglaude plus some of my own! | |
# | |
# https://github.com/dglaude/circuitpython_phat_on_pico/blob/main/keybow_mini.py | |
# | |
import time | |
import board | |
import digitalio | |
import adafruit_dotstar |
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
# Some of the below code is based on an example from Adafruit, please support them. | |
from time import sleep | |
import subprocess | |
from board import SCL, SDA | |
import busio | |
from PIL import Image, ImageDraw, ImageFont | |
import adafruit_ssd1306 | |
import sys |
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 board | |
import neopixel | |
from time import sleep | |
from random import randint | |
# Update this to match the number of NeoPixel LEDs connected to your board. | |
num_pixels = 6 | |
pixels = neopixel.NeoPixel(board.GP18, num_pixels) | |
pixels.brightness = 0.05 |
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 sentinelboard | |
from time import sleep | |
sb = sentinelboard.SentinelBoard() | |
sb.setServoPosition(1, 120) | |
sb.watchdogPause(0.2) | |
sleep(3) |
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
# Code for Brian Corteil's Tiny 4WD robot, based on code from Brian as modified by Emma Norling. | |
# Subsequently modified by Tom Oinn to add dummy functions when no explorer hat is available, | |
# use any available joystick, use the new function in 1.0.6 of approxeng.input to get multiple | |
# axis values in a single call, use implicit de-structuring of tuples to reduce verbosity, add | |
# an exception to break out of the control loop on pressing HOME etc. | |
# Modified by Brian Corteil to use @DrFootLeg's Sentinel robot controller hat | |
from time import sleep | |
try: |
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
colours = {'red': (254, 0, 0), 'green': (0, 254, 0), 'blue': (0, 0, 254), 'black': (0, 0, 0) } | |
# functions | |
def displayColour(colour): | |
global colours | |
print(f"{colour}'s RGB Value is { colours[colour] }") | |
# Main |
NewerOlder