Hello all,
I would like to wirelessly control a DC motor by rotating a potentiometer. I have the potentiometer hooked up to an arduino uno with a SparkFun xbee shield and a series 1 xbee. I want to attach the dc motor to an ardumoto shield from SparkFun (SparkFun Ardumoto - Motor Driver Shield - DEV-14129 - SparkFun Electronics) which will be attached to an arduino uno and another SparkFun xbee shield with another series 1 xbee. The two xbees are configured and below is a sample code I used to communicate between the xbees. (the second xbee was simple plugged into the usb and i read the seral values from the potentiometer). I would like to use the same transmitter code to control the DC motor but I don't know how to write the code for the receiver arduino.
thanks a lot,
Jon
transmitter code:
int potPin = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
int val = map(analogRead(potPin), 0, 1023, 0, 255);
Serial.println(val);
delay(50);
}