If I change that to 1 so the if statement is always true it does read the data but I get inconsistent numbers, I assume because it's not reading the data correctly, port timing is off or something like that. I have found that if I use Serial.available() > 0 in the if statement it doesn't read the serial port. To read the serial port I use the following Using python in the pi I can send the references up, my problem is sending them back and it seems to be a problem with using Serial.available in the mega. Once I know I can send the references up and back I'll use the pi for navigation. Now what I'm trying to do is send the speed and direction references to the pi and just send them back to the mega. I have a transmitter with 2 joysticks connected to a uno, it sends the joystick references to the rover via xbee wi-fi modules. The mega communicates to a raspberry pi via the serial port. I'm working on a rover that eventually will be autonomous, I have a GPS and compass module connected to a Arduino mega, the ESC and servos are controlled by the mega through a PCA9685 servo board.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |