Go Down

Topic: SKETCH FOR : XYLOPHONE WITH 8 SOLENOIDS (Read 2609 times) previous topic - next topic

I making a xylophone with 8 Notes similar to one at  http://www.nerdkits.com/videos/robotic_xylophone/.  It works on 8 solenoids striking metal bars producing different frequencies.  I need a basic sketch to play a tune such as "Twinkle Twinkle Little Star" or something else.  The source code suggested at http://www.nerdkits.com/videos/robotic_xylophone/xylophone.c is on C and thus will not work on Arduino.  Any guidance will be welcome.

Grumpy_Mike

The arduino is programmed in C so what is the problem with what you linked to.

This is my glockenspeal project it has a midi interface.
http://www.thebox.myzen.co.uk/Hardware/Glockenspiel.html

Thank you for the quick response, an excellent project. I am also constructing the same type of xylophone as you have done, however, what I am interested is writing an Arduino sketch to generate a tune with the solenoids striking various bars. I do not intend to use a MIDI interface.

As per your observations about the C pgme at the Nerd site, the sketch is generating errors regarding some declarations.

I would appreciate your help and guidance for the above issues. regards

Grumpy_Mike

It is just a matter of changing one or two things.
I have attached a zip file. Uncompress it and put it in your arduino code folder then start the arduino IDE.
You will find it has two tabs, the songs tab is basically  the original code with the loop and setup extracted.

I have compiled this but as I haven't got the hardware that is about as far as I can go. It does compile.

Thanks a lot, I appreciate your assistance,  I will rig up the hardware and give you feedback in due course.
regards

Can you pl  bring out the Pin Definitions, ie which solenoid is to be connected to which pin of Android board.

Grumpy_Mike


Can you pl  bring out the Pin Definitions, ie which solenoid is to be connected to which pin of Android board.

As I read the code it uses a shift register to output to the solenoides not direct from a pin.

I have worked on the code I recd from you.  The loop does not appear to execute after delay(..) statement.  I wonder why!  Next I want debugging I wanted to view the contents of SPDR at each stage on the monitor.  The code does not run after a few Serial.println statements, Is there a possibility of a conflict? can you pl guide in this respect. regards

Grumpy_Mike

Quote
The code does not run after a few Serial.println statements,

Code always runs, you can't stop it unless you put the processor to sleep.
Without the code you are working on it is impossible to say what is wrong so post it and we can all have a look. Also it would be good to see your schematic.

The sketch is attached herewith, it consists of two files, its primarily the same code sent by you earlier. regards

Runaway Pancake

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Go Up