Skip to content

Instantly share code, notes, and snippets.

@duhaime
Last active September 25, 2020 12:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save duhaime/afda6d3eac930a785d13d3b1bb45b1fa to your computer and use it in GitHub Desktop.
turing
from machine import Pin
import serial
# serial: https://pythonhosted.org/pyserial/pyserial.html#overview
# create an output pin on pin #8
out_pin = Pin(8, Pin.OUT)
# set the output pin to high mode
out_pin.value(1)
# args: device, bauds, timeout -- baud timeout must be exact
arduino = serial.Serial('COM3', 9600, timeout=.1)
data_prefix = bytearray([0x80, 0x83, 0xFF])
data_suffix = bytearray([0x8F])
all_dark = bytearray([
0B0000000, 0B0000000, 0B0000000, 0B0000000,
0B0000000, 0B0000000, 0B0000000, 0B0000000,
0B0000000, 0B0000000, 0B0000000, 0B0000000,
0B0000000, 0B0000000, 0B0000000, 0B0000000,
0B0000000, 0B0000000, 0B0000000, 0B0000000,
0B0000000, 0B0000000, 0B0000000, 0B0000000,
0B0000000, 0B0000000, 0B0000000, 0B0000000,
])
word_to_display = bytearray([
0B0000000, 0B0000000, 0B0101110, 0B0101010,
0B0111010, 0B0000000, 0B0000000, 0B0100010,
0B0101010, 0B0111110, 0B0000000, 0B0000000,
0B0000010, 0B0000010, 0B0111110, 0B0000000,
0B0000000, 0B0111110, 0B0000010, 0B0111110,
0B0000000, 0B0000000, 0B0010110, 0B0101000,
0B0101000, 0B0111110, 0B0000000, 0B0000000,
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment