hello guys, im trying to do a digital counter, from 1 to 128, but i get an error, this one, could someone tell me what is it
int n = 0
int 1 = 3
int 2 = 4
int 4 = 5
int 8 = 6
int 16 = 7
int 32 = 8
int 64 = 9
int 128 = 10
int a;
int b;
int c;
int d;
int e;
int f;
int g;
int h;
void setup() {
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(4, OUTPUT);
pinMode(8, OUTPUT);
pinMode(16, OUTPUT);
pinMode(32, OUTPUT);
pinMode(64, OUTPUT);
pinMode(128, OUTPUT);
}
void loop() {
a = n;
digitalWrite(1, a%2);
b = a/2;
digitalWrite(2, b%2);
c = b/2;
digitalWrite(4, c%2);
d = c/2;
digitalWrite(8, d%2);
e = d/2;
digitalWrite(16, e%2);
f = e/2;
digitalWrite(32, f%2);
g = f/2;
digitalWrite(64, g%2);
h = g/2;
digitalWrite(128, h%2);
}
the error is :
Arduino:1.6.0 (Windows 7), Placa:"Arduino Uno"
sketch_may15a.ino:2:1: error: expected ',' or ';' before 'int'
sketch_may15a.ino: In function 'void loop()':
sketch_may15a.ino:30:3: error: 'a' was not declared in this scope
Error de compilaciĆ³n