I am trying to get an LED to respond to a python program (using python 3.8), and it is not receiving anything. When I connect to the port, the led blinks to indicate it is connected, but then does nothing. Here is my code:
import serial
ser=serial.Serial('/dev/cu.usbmodem1411', 2000000, timeout=1)
ser.write(b'H')
time.sleep(200)
while True:
#read echo back from arduino verify receipt of message
#will show printing of x from arduino program
data = ser.readline()[:-2]
if data:
print (data.decode())
The while loop doesn't print out anything, and I also tried using the Arduino interface and it send signals fine, so my wiring is correct, but there is something missing with the python code. Has anyone run into this before?
