Hello, I'm currently trying to build a self-balancing robot with the arduimu as the brains of the operation driving a vex motor. To make pid tuning easier, I've been trying to get the ArduIMU to read data over serial. However, it appears Serial.read() is always returning -1 and Serial.available() never goes above 0. Any ideas why?

 

Tags: self-balancing, serial

Views: 142

Reply to This

Replies to This Discussion

ArduIMU uses a custom FastSerial library. I thought that was causing the problem, but I've since removed all calls for FastSerial (which is basically everything having to do with the GPS) and I still cannot read any serial input on the ArduIMU. Any luck on your end with this problem? (I know I'm about a year too late.)

Sorry, I abandoned my efforts to try and communicate with the ArduIMU over serial. I'd crack it open again to see if I could get it working a year later, but it's still stuck at school along with the rest of my stuff.

I figured it out! The ArduIMU V3 already receives serial data from the GPS connection. For some reason, the GPS uses the TX line of the AVR, then another random pin that is used for the RX line. The Serial port that the code is referring to is the GPS RX pin. There's a setting in the code that changes a Serial_Mux pin to select between the normal hardware RX pin and another pin on the board. There are two options: 

  1. Simply use the RX line on the GPS connection (labeled "IN' on the PCB).
  2. What I did was to change a setting (#define GPS_CONNECTION 0 // 0 for GPS pins, 1 for programming pins).  I changed that back to the regular RX/TX programming port pins.  I plugged my other peripheral on the normal port pins and everything started working perfectly using if(Serial.available()>0)  {...} I assume serial.event should work as well.

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service