Help programming 7x7x7 led cube

i built a 7x7x7 led cube on arduino mega 2560 using transistors to control anodes and cathodes. Could some one help me with a test code or something please?

Personally I would have made sure that I had some code before soldering 343 LEDs and associated components.
Where did you get the design from ? Has that site got any code ?

Actually I took pity on you and found this in about 10 seconds http://forum.arduino.cc/index.php/topic,8675.0.html

Well I Got the design and code from here http://www.instructables.com/id/Self-Contained-7x7x7-LED-Cube/?ALLSTEPS
i downloaded his code also but i keep getting a bunch of errors like this pushbutton does not name type. i can get a 4x4x4 cube code to work.

Post the whole code that you are using . It sounds like you have not installed a library correctly. What libraries does the code use, have you installed them and where ?

Also i had already looked at the one you posted aswell. But his does not contain his code =(

/**

  • LED_Cube
  • Code for an Arduino Mega to control an LED cube. Ports 0 to 48 should
  • switch the columns, with (0,0 to 6) going to ports 0 to 6,
  • (1,0 to 6) going to ports 7 to 13, etc.
  • Ports A0 through A6 control the layers with A0 controlling z = 0 and A6
  • controlling z = 6.
  • Ports A8 to A15 serve as inputs for the pushbutton switches.
  • Program written by Lopuz3
  • Spring 2013
    **/

#include <PushButton.h>
#include <CubeView.h>
#include <Routine.h>
#include <AllOn.h>
#include <CornerToCorner.h>
#include <CubeFrame.h>
#include <Fade.h>
#include <Ripple.h>
#include <Wave.h>
#include <PouringRain.h>
#include <BouncingBall.h>
#include <Particle.h>
#include <Firework.h>

#define CUBE_SIZE 7
#define NUM_BUTTONS 8
#define REFRESH_RATE 60

PushButton buttons[NUM_BUTTONS];
CubeView cube = CubeView();
Routine *currentRoutine = new Routine();

boolean lastCompleteFrame[CUBE_SIZE][CUBE_SIZE][CUBE_SIZE];

void setup()
{
setUpButtons();
setUpInterrupts();
}

void setUpInterrupts()
{
cli();//stop interrupts while we set them up
//set up an interrupt with timer1
TCCR1A = 0;
TCCR1B = 0;
TCNT1 = 0;
//make the interrupt ocurr at the correct frequency. The frequency is REFRESH_RATE*CUBE_SIZE
OCR1A = (16000000/REFRESH_RATE/1024/CUBE_SIZE -1);
TCCR1B |= (1 << WGM12);
// Set to CS10 and CS12 so we have the 1024
TCCR1B |= (1 << CS12) | (1 << CS10);
TIMSK1 |= (1 << OCIE1A);
sei();//reallow interrupts
}

void setUpButtons()
{
for(byte i = 0 ; i < NUM_BUTTONS ; i++)
{
buttons = PushButton(i+A8);

  • }*
    }
    //Called by timer interrupt
    ISR(TIMER1_COMPA_vect)
    {
  • cube.displayLayer(lastCompleteFrame);*
    }
    void loop()
    {
  • currentRoutine->update(getTimeSinceLastFrameInMicros());*
    memcpy(&lastCompleteFrame, &currentRoutine->cubeModel, sizeof(boolean)CUBE_SIZECUBE_SIZE*CUBE_SIZE);
  • getButtonInput();*
    }
    void getButtonInput()
    {
  • if(anyButtonWasPressed())*
  • {*
  • delete currentRoutine;*
  • currentRoutine = new AllOn();*
  • }*
  • if(buttons[0].wasReleased())*
  • {*
  • delete currentRoutine;*
  • currentRoutine = new CornerToCorner();*
  • }*
  • if(buttons[1].wasReleased())*
  • {*
  • delete currentRoutine;*
  • currentRoutine = new CubeFrame();*
  • }*
  • if(buttons[2].wasReleased())*
  • {*
  • delete currentRoutine;*
  • currentRoutine = new Fade();*
  • }*
  • if (buttons[3].wasReleased())*
  • {*
  • delete currentRoutine;*
  • currentRoutine = new Ripple();*
  • }*
  • if (buttons[4].wasReleased())*
  • {*
  • delete currentRoutine;*
  • currentRoutine = new Wave();*
  • } *
  • if (buttons[5].wasReleased())*
  • {*
  • delete currentRoutine;*
  • currentRoutine = new PouringRain();*
  • }*
  • if (buttons[6].wasReleased())*
  • {*
  • delete currentRoutine;*
  • currentRoutine = new BouncingBall();*
  • }*
  • if (buttons[7].wasReleased())*
  • {*
  • delete currentRoutine;*
  • currentRoutine = new Firework();*
  • }*
    }
    boolean anyButtonWasPressed()
    {
  • for(byte i = 0 ; i < NUM_BUTTONS ; i++)*
  • {*
    _ if(buttons*.wasPressed())_
    _
    {_
    _
    return true;_
    _
    }_
    _
    }_
    _
    return false;_
    _
    }_
    /Get the time since the last call of this function in microseconds/
    unsigned long getTimeSinceLastFrameInMicros()
    _
    {_
    _
    static unsigned long lastTime = 0;_
    _
    unsigned long dt = micros()-lastTime;_
    _
    lastTime = micros();_
    _
    return dt;_
    _
    }*_

Please, please put the code in code tags to make it readable.

So, lots of library files needed. Have you got them all installed and if so, where ?

I am sorry, how do i post it in code?

See point #6 of Read this before posting a programming question ... - Programming Questions - Arduino Forum

Thanks for the help ukhelibob. I got it working, library was in wrong folder. By the way the heli in your name, would it have to do with rc helis?

I am glad that it is sorted. I would hate for all of that soldering to go to waste.
RC helis - yes, but only in a small way.