Linking sketches

The "Cube4" is a 4x4x4 RGB LED cube with an Arduino Leonardo compatible onboard controller. [Product page]
Post Reply
hotddogink
Posts: 4
Joined: Sat Jun 18, 2016 3:00 am

Linking sketches

Post by hotddogink » Fri Jul 29, 2016 3:56 am

My cube is working well. Is it possible to link several sketches together so that the cube behavior jumps to the next sketch then returns to the start again

danieldewaard
Freetronics Staff
Freetronics Staff
Posts: 21
Joined: Thu Jul 14, 2016 2:41 am

Re: Linking sketches

Post by danieldewaard » Tue Aug 02, 2016 1:08 am

Hi hotdogink,

This is definitely possible! Im sure you are aware that the loop function in an Arduino sketch, like the name suggests keeps repeating for as long as the Arduino is on. This means if you have each "sketch" running once after the other within your loop function you will end up with the functionality you are after. Might I suggest putting each sequence into it's own "function" and then calling each function in the order you desire from within "loop". I hope this helps.

Basically, rather than linking sketches as such you want to combine the sketches into one "sketch" that you can upload and run on your cube.

Let me know if you need it explained more clearly,

Daniel

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests