Go Down

Topic: Project due next week and I don't know what I'm doing... (Read 510 times) previous topic - next topic

DanLo1108

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.

Arrch


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?

DanLo1108

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

DanLo1108

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

Arrch

#4
Dec 01, 2012, 05:12 am Last Edit: Dec 01, 2012, 05:15 am by Arrch Reason: 1

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.


dhenry

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


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

Go Up