Pages: [1]   Go Down
Author Topic: Project due next week and I don't know what I'm doing...  (Read 501 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

We just learned about arduinos in electronics class. I have a project due next week and I'm still struggling with the concepts. Here is what I want to do:

I want to play a song on the speaker connected to the arduino, while simultaneously displaying some visual display corresponding to the song. I want to have multiple songs and displays, and they have to be triggered by something, like a button on the laptop keyboard.

I've been playing around with the arduino tone function, and it's simple enough. My professor said that I need processing for the visual display, so I was wondering if I could run the processing program simultaneously with the arduino?

On a side note, I'd love to be able to harmonize the songs. I know I can't run two tone functions at once, and sending mixed frequencies to the speaker is very difficult. Is it possible to run two arduino programs at once, though? Or any other way to play chords?

Any help would be greatly appreciated.
Logged

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3435
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

so I was wondering if I could run the processing program simultaneously with the arduino?

Arduino sketches run on an Arduino and don't rely on the computer to run.
Processing programs run on a computer and don't rely on the Arduino to run.

Unless you are starving for electricity, I don't see why Arduino can't do its thing while Processing does its.

Quote
Is it possible to run two arduino programs at once, though?

Sure you just need two Arduinos. The more cost effective option, though, is to combine the two sketches using multitasking techniques, such as those showcased in the Blink with Delay example.

Quote
Or any other way to play chords?

On one what I am assuming is a small piezo speaker?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yup just a regular piezo. And what kind of multitasking techniques are you referring to?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So if I have one program that outputs to pin 8, and one that outputs to pin 9, they can't run together?
Logged

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3435
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yup just a regular piezo. And what kind of multitasking techniques are you referring to?

Quote
such as those showcased in the Blink with Delay example.

So if I have one program that outputs to pin 8, and one that outputs to pin 9, they can't run together?

Nope. You can, however, write a single sketch that outputs to pin 8 and outputs to pin 9 simultaneously.
« Last Edit: November 30, 2012, 11:15:33 pm by Arrch » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Gotcha. Thank you!
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't know what I'm doing...

That's your problem and solution at the same time.
Logged

Pages: [1]   Go Up
Jump to: