Hi, im new to arduino and even newer to this forum.
I know I have made a lot of structural mistakes but once again, im a newbie.
the project im working on is a 3x3x3 ledcube. in this version of the code the whole cube should turn on for half a second and then turn of for half a second and repeat, however the cube will be able to show cool animations if i take the time to make them
the error im getting when I compile the code is: ledcube_v0_2:14: error: expected unqualified-id before '{' token
the code:
/*
update V 0.2
figured out how to display animations
lets see how it works out
*/
const int LAY[3] = {11, 12, 13}; //sets pins 11-13 as layers
const int COL[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};//sets pins 1-9 as collumns
boolean leds[27] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};//represents if the leds are on or off
int LEDno = 1; //used in above data to pick a LED
void actual_animate();//summary: write the pins high, go to next led
{//this is where the compiler starts complaining
if (boolean leds[int LEDno] == 1);//if the led is on...
{
if (1 >=int LEDno >= 9){digitalWrite(LAY[1], HIGH);}//top layer
if (10 >=int LEDno >= 18){digitalWrite(LAY[2], HIGH;)}//middle layer
if (19 >=int LEDno >= 27){digitalWrite(LAY[3], HIGH;)}//bottom layer
if (int LEDno == 1 || int LEDno == 10 || int LEDno == 19){digitalWrite(COL[1]);}//collumn 1
if (int LEDno == 2 || int LEDno == 11 || int LEDno == 20){digitalWrite(COL[2]);}//collumn 2
if (int LEDno == 3 || int LEDno == 12 || int LEDno == 21){digitalWrite(COL[3]);}//collumn 3
if (int LEDno == 4 || int LEDno == 13 || int LEDno == 22){digitalWrite(COL[4]);}//collumn 4 1 2 3
if (int LEDno == 5 || int LEDno == 14 || int LEDno == 23){digitalWrite(COL[5]);}//collumn 5 layout goes like: 4 5 6
if (int LEDno == 6 || int LEDno == 16 || int LEDno == 24){digitalWrite(COL[6]);}//collumn 6 7 8 9
if (int LEDno == 7 || int LEDno == 17 || int LEDno == 25){digitalWrite(COL[7]);}//collumn 7
if (int LEDno == 8 || int LEDno == 18 || int LEDno == 26){digitalWrite(COL[8]);}//collumn 8
if (int LEDno == 9 || int LEDno == 19 || int LEDno == 27){digitalWrite(COL[9]);}//collumn 9
}
LEDno++;//goes to the next LED
unsigned int breaktime = millis;
unsigned int elapsedtime = starttime - breaktime;
}
void frame(unsigned int duration, boolean leds[27]);
{
unsigned int starttime = millis;//measures the starttime
if(int LEDno =< 28){int LEDno = 1};//sets the LEDno back to one if LEDno is invalid
//if LEDno is valid just continue
while(elapsedtime <= duration)
{
void actual_animate();
}
}
void setup()
{
pinMode(LAY[], OUTPUT);//sets all used pins as outputs
pinMode(COL[], OUTPUT);
}
void loop()
{
boolean leds[27] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
void frame(500, leds);
boolean leds[27] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
void frame(500, leds);
}