fix indent
This commit is contained in:
parent
8789a0d161
commit
bf26a26e73
24
8x8x8.ino
24
8x8x8.ino
|
@ -30,33 +30,33 @@ const byte ICtable[9]={
|
||||||
};
|
};
|
||||||
|
|
||||||
void writeCube(int tdelay){
|
void writeCube(int tdelay){
|
||||||
static int currentLayer=0;
|
static int currentLayer=0;
|
||||||
unsigned long startedAt = millis();
|
unsigned long startedAt = millis();
|
||||||
while(millis() - startedAt < tdelay){
|
while(millis() - startedAt < tdelay){
|
||||||
|
|
||||||
delay(1);// wait a bit on previous layer
|
delay(1);// wait a bit on previous layer
|
||||||
digitalWrite(layersPins[currentLayer],LOW);//turn off current Layer
|
digitalWrite(layersPins[currentLayer],LOW);//turn off current Layer
|
||||||
|
|
||||||
//change currentLayer
|
//change currentLayer
|
||||||
if(currentLayer == 8)
|
if(currentLayer == 8)
|
||||||
currentLayer=0;
|
currentLayer=0;
|
||||||
else
|
else
|
||||||
currentLayer++;
|
currentLayer++;
|
||||||
|
|
||||||
digitalWrite(pinOE, HIGH);//Output Enabled off
|
digitalWrite(pinOE, HIGH);//Output Enabled off
|
||||||
//lines
|
//lines
|
||||||
PORTB=ICtable[0];//set IC
|
PORTB=ICtable[0];//set IC
|
||||||
for(int ligne=0;ligne < 8; ligne++){
|
for(int ligne=0;ligne < 8; ligne++){
|
||||||
//write BUS for this leds'line
|
//write BUS for this leds'line
|
||||||
for (int led=0;led <8;led++){
|
for (int led=0;led <8;led++){
|
||||||
digitalWrite(busPins[led], cube[currentLayer][ligne][led]);
|
digitalWrite(busPins[led], cube[currentLayer][ligne][led]);
|
||||||
}
|
}
|
||||||
PORTB=ICtable[ligne +1]; //74HC574 is writen when clock pin goes LOW to HIGH. SO go to the next value for IC.
|
PORTB=ICtable[ligne +1]; //74HC574 is writen when clock pin goes LOW to HIGH. SO go to the next value for IC.
|
||||||
}
|
}
|
||||||
//OE ON
|
//OE ON
|
||||||
digitalWrite(pinOE, LOW);
|
digitalWrite(pinOE, LOW);
|
||||||
//layer on
|
//layer on
|
||||||
digitalWrite(layersPins[currentLayer],HIGH);
|
digitalWrite(layersPins[currentLayer],HIGH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void fillCube(){
|
void fillCube(){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user