I have tried use a array to control the state of leds but i can't i have tried with int[] and bool[] but still not work yet...
Someone could say me what is to fail?
this is my code:
I want controlling the leds states that this form cause I think use a Three dimensional array to form letters in rotary system POV but for the moment I need know how use arrays of this form...
Sorry, my english is limited,
//int or bool type the trouble still there
int statesArray[5]={0,1,1,1,0,1};
int pin=2;
void setup()
{
while(pin<8)
{
pinMode(pin,OUTPUT);
pin++;
}
}
void loop()
{
pin = 2;
while(pin<8)
{
digitalWrite(pin,statesArray[pin-2]);
pin++;
delay(550);
}
}
I don't know about what you expect your sketch to do, but I suggest you look at the difference the use of " : " and " ; " makes. Secondly. how many elements does your array have??
Sorry wrong key, my code it's more extensive so, i only write the more important, but my problem not is of sintaxis error, in my code, compiling doens't give error but not work...
I think that my problem is in digitalWrite(pin,//here);, that not activate the pin...
My array have 5 elements.
This is that i did. but the code its very extensive so that i think to use a three dimensional array to have
The code you didn't post does something. You expect it to do something.
All we know at this point is that the two somethings are not the same thing. With only that information, we can not tell you why your expectations are wrong.
In the description of digitalWrite(pin,value) it says that the valid values for value is LOW and HIGH. Are you certain that 1 and 0 can be used instead of LOW and HIGH?