Hello There.
I built a RGB CUBE 8x8x8. (MEGA2560 + 12xDM13 + 74HC595 layer)
I attached my test functional prg.
On the net I found a template, but it is written for "Chipkit UNO32".
I need help to convert it to a format Arduino.
Here is attached the source file.
Whole source "雅博体育官网入口 - BoYa用户中心"
Are there any specific points you need help with? I assume you were not expecting someone here would do all the hard work for you. It would show willing on your part if you could give a schematic and links to the important components you have used (I googled dm13 and it appears to be a paintball gun!).
I do not want that for me someone did all the work. I have a problem with the refresh routine. I was thinking I might use the library "timerOne" #include <TimerOne.h>
Timer1.initialize(800000);
Timer1.attachInterrupt(refresh); Interruption after a 8ms refresh routine:
void refresh() {
byte red, green, blue;
for (byte count=0; count<6; count++){ // BAM counter; každý přírůstek zdvojnásobuje dobu LED je na, začíná na 5 microsecs.
digitalWrite(Latch, LOW ); //Ujistěte se, že výstupy jsou nakloněný
digitalWrite(SDIR, LOW);
digitalWrite(SDIR, LOW);
digitalWrite(SDIR, LOW);
for (byte layer=0; layer<8; layer++){ // skenování přes každou vrstvu
for (byte column=0; column<8; column++){ // skenování přes každý sloupec
for (byte panel=0; panel<8; panel++){ // skenování přes každém panelu
red = cube[column][panel][layer][0]; // prosadit svou červenou složku
if ((red & 1<<count)>0) { // BAM to a přesunout ji
digitalWrite(SDIR, HIGH);
}
green = cube[column][panel][layer][1]; // prosadit svou zelenou složku
if ((green & 1<<count)>0) { // BAM to a přesunout ji
digitalWrite(SDIG, HIGH);
}
blue = cube[column][panel][layer][2]; // prosadit svou modrou složku
if ((blue & 1<<count)>0) { // BAM to a přesunout ji
digitalWrite(SDIB, HIGH);
}
digitalWrite(CLK, HIGH);
digitalWrite(CLK, LOW);
digitalWrite(SDIR, LOW);
digitalWrite(SDIG, LOW);
digitalWrite(SDIB, LOW);
}
}
digitalWrite(LA, HIGH);
digitalWrite(LA, LOW);
this is only part kodu-.
Millis () does not solve anything, I need a subroutine to "refresh", worked in the interruption, after 8ms, outside the main program.
"millis()" is the core of writing sketches that can perform more than one task simultaneously. Until you learn how to use it, you are going to be pushing the proverbial uphill.