I am trying to control the operation of a DC motor by sending serial commands to the arduino using a python script.
I am able to get the first serial input read fine (which turns the motor on), but can’t seem to get the the arduino to read a second serial input properly from the python script to turn the motor back off as well.
The codes are in the attachments, for some reason I was getting cloudflare blocked when trying to paste it in directly
I have tried many different variations of trying to clear the serial input buffer before sending the second serial write via python but nothing seems to be working. Wondering if I’m missing something else or if my program just needs something extra added that I dont know about.
Thanks for the help!