I've written a sketch to remote control my Rover 5 with another Arduino with an analog joystick attached. That code works. My motor controller has 4 pins that give a 0-5V output depending on the current the 4 motors draw (5V = 5A). So I wrote some code to sent the values to the serial monitor and I'm having some problems.
The sketch that works can be found here -> http://www.bajdi.com/remote-controlling-the-dagu-rover-5-with-a-joystick/
When I add the following code to that sketch it stops working.
float current; // Array with the 4 motor current values, to sent to remote control
// 4 analog readings from motor controller = motor current
int m1 = analogRead(A1);
current = m1 / 1024.0 * 5.0; // 1024 = 5A
Serial.print("current motor 1 = ");
int m2 = analogRead(A2);
current = m2 / 1024.0 * 5.0;
Serial.print("current motor 2 = ");
int m3 = analogRead(A3);
current = m3 / 1024.0 * 5.0;
Serial.print("current motor 3 = ");
int m4 = analogRead(A4);
current = m4 / 1024.0 * 5.0;
Serial.print("current motor 4 = ");
What am I doing wrong? I would like to sent the current array to the remote control to display it on an LCD.