Hi, I am getting my arduino on Christmas and I want to have some kind of a project ready before then, but when i click verify it gives me a error message that I don't understand and would like help with.
The error message is: error: expected ',' or '...' before numeric constant
I have started o learn arduino code on Thursday and because I have learned some of Turing and I am a good logical thinker I have created this.
This will control bunch of LED's to create a number and change it to the next one.
If the button is pressed then right now one LED blinks and when I will figure out the error then I will make itso another button changes it on command.
#define t 2 //Top LED's
#define tl 3 //Top Left LED's
#define tr 4 //Top Right LED's
#define m 5 //Middle LED's
#define bl 6 //Bottom Left LED's
#define br 7 //Bottom Right LED's
#define b 8 //Bottom LED's
#define d 9 //Dot
#define s 10 //Button
#define de 100 //delay
int n = 0;
int number0(){
digitalWrite (t, HIGH);
digitalWrite (tl, HIGH);
digitalWrite (tr, HIGH);
digitalWrite (bl, HIGH);
digitalWrite (br, HIGH);
digitalWrite (b, HIGH);
n = 0;
}
int number1(){
digitalWrite (t, LOW);
digitalWrite (tr, HIGH);
digitalWrite (tl, LOW);
digitalWrite (m, LOW);
digitalWrite (br, HIGH);
digitalWrite (bl, LOW);
digitalWrite (b, LOW);
n = 1;
}
int number2(){
digitalWrite (t, HIGH);
digitalWrite (tr, HIGH);
digitalWrite (tl, LOW);
digitalWrite (m, HIGH);
digitalWrite (br, LOW);
digitalWrite (bl, HIGH);
digitalWrite (b, HIGH);
n = 2;
}
int number3(){
digitalWrite (t, HIGH);
digitalWrite (tr, HIGH);
digitalWrite (tl, LOW);
digitalWrite (m, HIGH);
digitalWrite (br, HIGH);
digitalWrite (bl, LOW);
digitalWrite (b, HIGH);
n = 3;
}
int number4(){
digitalWrite (t, LOW);
digitalWrite (tr, HIGH);
digitalWrite (tl, HIGH);
digitalWrite (m, HIGH);
digitalWrite (br, HIGH);
digitalWrite (bl, LOW);
digitalWrite (b, LOW);
n = 4;
}
int number5(){
digitalWrite (t, HIGH);
digitalWrite (tr, LOW);
digitalWrite (tl, HIGH);
digitalWrite (m, HIGH);
digitalWrite (br, HIGH);
digitalWrite (bl, LOW);
digitalWrite (b, HIGH);
n = 5;
}
int number6(){
digitalWrite (t, HIGH);
digitalWrite (tr, LOW);
digitalWrite (tl, HIGH);
digitalWrite (m, HIGH);
digitalWrite (br, HIGH);
digitalWrite (bl, HIGH);
digitalWrite (b, HIGH);
n = 6;
}
int number7(){
digitalWrite (t, HIGH);
digitalWrite (tr, HIGH);
digitalWrite (tl, LOW);
digitalWrite (m, LOW);
digitalWrite (br, HIGH);
digitalWrite (bl, LOW);
digitalWrite (b, LOW);
n = 7;
}
int number8(){
digitalWrite (t, HIGH);
digitalWrite (tr, HIGH);
digitalWrite (tl, HIGH);
digitalWrite (m, HIGH);
digitalWrite (br, HIGH);
digitalWrite (bl, HIGH);
digitalWrite (b, HIGH);
n = 8;
}
int number9(){
digitalWrite (t, HIGH);
digitalWrite (tr, HIGH);
digitalWrite (tl, HIGH);
digitalWrite (m, HIGH);
digitalWrite (br, HIGH);
digitalWrite (bl, LOW);
digitalWrite (b, HIGH);
n = 9;
}
void setup ()
{
for (int x = t; x <= d; x++) {
pinMode (x, OUTPUT);
}
pinMode (s, INPUT);
digitalWrite (t, HIGH);
digitalWrite (tl, HIGH);
digitalWrite (tr, HIGH);
digitalWrite (bl, HIGH);
digitalWrite (br, HIGH);
digitalWrite (b, HIGH);
digitalWrite (d, HIGH);
}
void loop ()
{
while (digitalRead == LOW){
switch (n){
case 0:
number0();
case 1:
number1();
case 2:
number2();
case 3:
number3();
case 4:
number4();
case 5:
number5();
case 6:
number6();
case 7:
number7();
case 8:
number8();
case 9:
number9();
}
if (n == 9){
n = 0;
}
else {
n++;
}
}
digitalWrite (d, LOW);
delay (100);
digitalWrite (d, HIGH);
delay (100);
}