Updating for Pi.
This commit is contained in:
parent
18e6ea738e
commit
ace73c3994
1 changed files with 8 additions and 8 deletions
|
|
@ -1,18 +1,18 @@
|
|||
import board
|
||||
import busio
|
||||
from digitalio import DigitalInOut, Direction
|
||||
|
||||
try:
|
||||
import struct
|
||||
except ImportError:
|
||||
import ustruct as struct
|
||||
|
||||
led = DigitalInOut(board.D13)
|
||||
led.direction = Direction.OUTPUT
|
||||
|
||||
# Connect the Sensor's TX pin to the board's RX pin
|
||||
# Connect the sensor TX pin to the board/computer RX pin
|
||||
# For use with a microcontroller board:
|
||||
import board
|
||||
import busio
|
||||
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 = []
|
||||
|
||||
while True:
|
||||
Loading…
Reference in a new issue