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:
|
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:
|
||||||
Loading…
Reference in a new issue