timmyj
December 8, 2023, 4:42am
1
#include <LedCube.h>
#include <newfix.h>
#define SIZE 3
#define COLS SIZE * SIZE
byte levelPins[SIZE] = {11,12,13};
byte colPins[COLS] = {2,3,4,5,6,7,8,9,10};
LedCube wow(SIZE, levelPins, colPins);
void setup() {
// light each light one at a time
for(byte level=0; level<wow.getLevels(); level++)
{
for(byte col=0; col<wow.getCols(); col++)
{
wow.lightPulse(level, col, 100);
delay(1000);
}
}
}
void loop() {
// put your main code here, to run repeatedly:
}
When i go to upload the code it compiles without error but it does not work
timmyj
December 8, 2023, 4:47am
2
Sorry about the wow., i tried changing the object to see if it would make a difference
xfpd
December 8, 2023, 5:04am
3
timmyj:
does not work
Check your LEDs for polarity. One in each plane would stop all from lighting.
timmyj
December 8, 2023, 5:11am
4
When i exclude the library from the sketch and use for loops to control the cube it actually works
I have had this same cube working with this library on a different pc and an older ide
xfpd
December 8, 2023, 6:09am
5
Then you know what you need.
You do not need a library.
int led[]={2, 3, 4};
void setup() {
for (int i = 0; i < 3; i++) {
pinMode(led[i], OUTPUT);
}
}
void loop() {
for (int i = 0; i < 3; i++) {
digitalWrite(led[i], HIGH);
delay(300);
}
delay(300);
for (int i = 0; i < 3; i++) {
digitalWrite(led[2-i], LOW);
delay(300);
}
delay(300);
}
system
Closed
June 5, 2024, 6:09am
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.