Last active
September 25, 2020 12:21
Star
You must be signed in to star a gist
turing
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 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