I am building a wi-fi controlled RC car as a project for school. I am using a Raspberry Pi as a nodejs web server that when a button is clicked on the client side sends out a 1, 2, 3, or 4 over Serial (for FRWD, LEFT, RIGHT, and BKWD). The arduino's job is to read the data and then control the motors. I am running into the problem that my ardunio just keeps reading the last number that was sent through. I need someway of clearing the serial buffer after each Tx from the pi. Hope that makes sense. I have tried several different ways but I have finally hit a wall. Please help!
Aucun commentaire:
Enregistrer un commentaire