I'm making my first program, and I'm making it before I buy the board to be sure it runs correctly and I don't waste money...
The compiler sends me an error message, but I can't find what is wrong...
The program have to move 4 motors with the variable impulse of 4 respective potentiometers, here is the sketch:
const int servopina=3; //output pin numbers
const int servopinb=5;
const int servopinc=6;
const int servopind=9;
const int inpina=0; //input pin numbers
const int inpinb=1;
const int inpinc=2;
const int inpind=3;
int storea=0; //input storing variables
int storeb=0
int storec=0
int stored=0
void setup() {
pinMode(servopina, OUTPUT);
pinMode(servopinb, OUTPUT);
pinMode(servopinc, OUTPUT);
pinMode(servopind, OUTPUT);
pinMode(inpina, INPUT);
pinMode(inpinb, INPUT);
pinMode(inpinc, INPUT);
pinMode(inpind, INPUT);
}
void loop() {
storea=analogRead(inpina);
storeb=analogRead(inpinb);
storec=analogRead(inpinc);
stored=analogRead(inpind);
map(storea, 0, 1023, 0, 254);
map(storeb, 0, 1023, 0, 254);
map(storec, 0, 1023, 0, 254);
map(stored, 0, 1023, 0, 254);
analogWrite(servopina, storea);
analogWrite(servopinb, storeb);
analogWrite(servopinc, storec);
analogWrite(servopind, stored);
}
I chose the pin numbers with the help of the description of an Arduino 2009 that said these pins where the analog input and PWM ones...
The error the compiler sends is this:
error: expected unqualified-id before numeric constant In function 'void loop()':
Bad error line: -2
What does this mean? How can I make this run correctly?
Thank you to everyone that will help!
ps: Sorry for the possible grammatical errors, but I'm not anglophone, and I'm not too good in it...