uno

Can the uno do multi things at different times? I have a project which includes LED's, Stepper motor, and sound board. Will the uno do all of this or do I need a different one. Thanks Craig

Have a look at the demo Several Things at a Time

...R

See [u]Demonstration code for several things at the same time[/u] at the top of the forum.

...Actually, a CPU (a single-core CPU) can only do one instruction at a time. Multitasking is done by rapidly switching between tasks. If there's an operating system, the operating system takes care of the multitasking. But since the Arduino doesn't have an operating system, you have to take care of it in your code.

The stepper motor library works "in the background" so it shouldn't be a problem (depending on how you're using it).

If you're using an audio shield, the audio shield has it's own sample-rate clock and it's own memory, and it's own MP3 decoder if you're playing mp3s, etc. So, all the Arduino has to do is start/stop the sound and adjust the volume, etc.

as far as programming is concern, will there be enough room to do it.

First the LED's flashing, the sound of bells, the stepper motor runs forward then reverse, the bells stop and last the LED's cut off

msilhunter:
First the LED's flashing, the sound of bells, the stepper motor runs forward then reverse, the bells stop and last the LED's cut off

Yes. Or maybe no.

Would i need a different one or split it up and use two uno's

msilhunter:
Would i need a different one or split it up and use two uno's

A different one?
Maybe.
Or maybe not.

I have never used an Arduino before. I trying to set-up a rotary coal dumper for a model trains. 4 Led's are green until the train enter the dumper then the train stops the LED's light turn to red, the sound of bells come on, the stepper will start turning for about 4 second and pause for 1 second and then reverse back to a fix position after that the LED's will turn back to green. My question is can the UNO handle this or do I have to think of another way. I don't know how much can the processor can handle.If it can't handle this can you combine two UNO's to complete this task.

I don't believe the "sound of bells" is trivial. I think that it is the biggest part of this build. The Uno (and most other Arduinos) can't synthesize sounds and can only just barely get uncompressed sound data off an SD card and send it to an amplifier.

If you have a pre-recorded sound of bells and a player device which can be triggered by the Arduino then the Arduino code is simple but you need to build that player into the project.

The Teensy Arduinos do have much greater capacity for making sounds but they don't have a speaker on board so amplification is required.

I agree that 'sound of bells' is a bit vague. In it's simplest form, you can use an old-fashioned 12V (or so) doorbell and a relay (board).

You have a sound card in mind, so you can buy a mp3 player shield that will take most of the hard work out; e.g. SparkFun MP3 Player Shield. There are others, do a search for Arduino MP3. I have no experience with sound on an Arduino but your description sounds very feasible for an Uno.

I would say: buy a starter kit and start playing; if at the end-of-the day you find that it does not have enough memory, you can always upgrade the Uno to something else (Mega, Due, Teensy) and use the Uno for another project.

It is possible to play a simple WAV file from an SD Card with the the TMRh20/TMRpcm library. I created a WAV file with the first 30 seconds of Donna Summer's "Love to love you baby" converted to 32kHz 8bit mono and it played very well through my amplified speakers.

...R

OK thanks for all the help.