Updating for Pi.

This commit is contained in:
Kattni Rembor 2019-11-06 12:37:33 -05:00
parent 18e6ea738e
commit ace73c3994

View file

@ -1,18 +1,18 @@
import board
import busio
from digitalio import DigitalInOut, Direction
try: try:
import struct import struct
except ImportError: except ImportError:
import ustruct as struct import ustruct as struct
led = DigitalInOut(board.D13) # Connect the sensor TX pin to the board/computer RX pin
led.direction = Direction.OUTPUT # For use with a microcontroller board:
import board
# Connect the Sensor's TX pin to the board's RX pin import busio
uart = busio.UART(board.TX, board.RX, baudrate=9600) uart = busio.UART(board.TX, board.RX, baudrate=9600)
# For use with Raspberry Pi/Linux:
# import serial
# uart = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=0.25)
buffer = [] buffer = []
while True: while True: