Pages: [1]   Go Down
Author Topic: Multiple Program Arduino/Processing Question!  (Read 979 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For an xmas project I would like to combine all three of the following projects (Links below) to only 1 arduino and 1 computer. The wiring is not a problem, the programming is. Is this even possible? If yes, how can I do it?
P.S. I have an arduino duemilanove
http://www.instructables.com/id/How-to-Make-LEDs-Flash-to-Music-with-an-Arduino/

http://www.instructables.com/id/USB-bronze-bell-striking-clock-with-Arduino/

http://www.instructables.com/id/Arduino-XMAS-hitcounter/

Tnx gaiz!
<3 Buzz
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26327
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Assuming the combined memory requirements are not too great for a single processor, and you have a means of selection which you want to run, I don't think there are too many difficulties.

Start by putting the code from each sketch's "loop" into a separate function, modify the new "loop" to call one based on the selection mechanism,  and see where you get to.

Come back if you have any specific questions.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I need to run them all simultaniously, along with their respective processing and computer commands.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 614
Posts: 49376
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I need to run them all simultaniously
Your idea of simultaneous and the Arduino's idea of simultaneous may not be the same thing. Ringing a bell every half hour does not require critical timing.

Reacting to serial commands is also not a highly time-critical application. If you miss by 10 or 20 clock cycles, when a clock cycle completes in 62.5 nanoseconds, are you going to be able to detect that?

Neither of there functions will tax the Arduino.

Making LEDs flash to music, on the other hand, will. Processing the serial data and ringing the bells, will cause the LEDs to have issues when the other functions need to do stuff.

Whether you will even notice, though, is hard to say. Is it critical? Of course not.
Logged

Pages: [1]   Go Up
Jump to: