Sorry for dispelling your name. Very good idea Floresta. I guess by the two wires you meant RX and TX right?
Well here what I did:
I tried to see if it'll first work with a simple program like the one made by Jeremy blum. where he used two arduinos (first one to read a pot input and the second to get the input of the pot from the first and turn servo motor on the second arduino) His code is correct, and verified, but when I apply it to mine the motor just goes crazy when I turn the pot and it doesn't stop. It just vibrates like a phone. No turning as you turn the pot.
Here is the code of Jeremy just that you see what I am talking about:
/*The pot in the first Arduino
int potPin = 0;
void setup()
{
Serial.begin(115200);
}
void loop()
{
int val = map(analogRead(potPin), 0, 1023, 0, 9);
Serial.println(val);
delay(50);
}
//The servo in the second arduino
#include <Servo.h>
int servoPin = 9;
Servo mysServo;
void setup()
{
Serial.begin(115200);
mysServo.attach(servoPin);
delay(500);
}
void loop()
{
while( Serial.available() == 0);
int data = Serial.read() -'0';
int pos = map(data, 0, 9, 0, 180);
pos = constrain(pos, 0, 180);
//turn
Serial.println(pos);
mysServo.write(pos);
Serial.flush();
}
please provide some feedback.
Thanks