[solved] Mega2560 for a 8x8x8 RGB Cube


hello i'm beginner arduino if can me great

i have build 8x8x8 rgb led cube powered arduino uno or standalone atmega328p , works fine. sketch cube made else , did make effects myself memory on atmega328p got small bought mega2560 because of memory. 25 shift registers (74hc595) connected 4 wires of uno pin 2 (latch), pin 4 (blanc), pin 11 (mosi), , pin 13 (sck).
i notice on mega2560 mosi pin 51 , sck pin 52 changed in sketch , wires cube won't work, compiles/writes without errors, can see program runs serial.print of leds in cube go on , stay on , nothing should do. if have suggestion

attached code work on uno ( pin 2, 4, 11, 13)

a video of 8x8x8 rgb led cube build (long version)
 http://www.youtube.com/watch?v=gghpge0yrg8

what pin ss on mega? 50,  or 53?

i don't understand why hardware ss pin, d10, not used here - must set output anyway, why not use latch_pin??

#define latch_pin 2// can use pin want latch shift registers

change 2 10 uno, , 50 or 53 mega


these lines should not needed @ all, spi library takes care of assigning them:

#define data_pin 11// used spi, must pin 11
#define clock_pin 13// used spi, must 13

pinmode(data_pin, output);//mosi data
pinmode(clock_pin, output);//spi clock

same here, these defaults:

spi.setbitorder(msbfirst);//most significant bit first
spi.setdatamode(spi_mode0);// mode 0 rising edge of data, keep clock low


Arduino Forum > Using Arduino > LEDs and Multiplexing > [solved] Mega2560 for a 8x8x8 RGB Cube


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62