Hello, well i am eventually going to use this code to control a larger led matrix in which i need to turn on more than one led at a time, so as i understand it, the best way to do that is to blink them on and off really fast so i want to make the code to blink each one on and off an integer so i don't have to type it in alot. Also i was wondering if there was a repeat function, so i can repeat a certain string of code a few times. (Im making an analog clock)
this is the link to my original form: Arduino Forum
Well i know i am doing something wrong, i want to know how to fix it and or a better way to do it. here is the code
int led3 = 3 ;
int led4 = 4;
int n ;
int x ;
void setup() {
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
}
void loop()
{
n = {
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(3, LOW);
delay(1000);
}
x = {
digitalWrite(4, HIGH);
delay(1000);
digitalWrite(4, LOW);
delay(1000);
n;
m;
n;
m;
}
Im getting an error message at " n = {"
arduino says the error is: expected primary expression before '{' token
Blink.cpp: In function 'void loop()':
Blink:14: error: expected primary-expression before '{' token
Blink:14: error: expected ;' before '{' token Blink:21: error: expected primary-expression before '{' token Blink:21: error: expected
;' before '{' token
Blink:31: error: expected `}' at end of input
PLEASE HELP, thanks