Hi all. as you can probably tell by my user name, i'm new to arduino.
i intend on making a program on my pc that tracks my mouse movement, and communicates which way i move the mouse via serial.
now my problems are:
1. i do not know how to program anything. i've never learned how. but i have lots of free time, so i'm willing to learn.
2. i do not have internet access at home, and i cannot bring a USB stick with the arduino software to verify code (please can someone verify it for me?)
3. provided i tell the program to communicate mouse movement +x as 1 and -x as 2, would the below code work to move a servo left and right? i intend on having real time control...
here's the code:
#include <servo.h>
Servo ser1;
int input, 0;
int pos, 0;
void Setup() {
serial.begin (9600);
ser1.attach(5);
}
Void Loop() {
int input == serial.Read();
if (input == "1") {
if(pos<180)
++pos;
}
if (input == 2) {
if (pos > 0)
--pos;
}
ser1.write(pos);
}
thanks for your time :-)