Pages: [1]   Go Down
Author Topic: SKETCH FOR : XYLOPHONE WITH 8 SOLENOIDS  (Read 1962 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31343
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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

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
 
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31343
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

* Xylophone.zip (3.14 KB - downloaded 13 times.)
Logged

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

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

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

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31343
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

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
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31343
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

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

* Xylophone2.ino (1.13 KB - downloaded 9 times.)
* songs.ino (10.8 KB - downloaded 8 times.)
Logged

Offline Offline
Edison Member
*
Karma: 56
Posts: 2182
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also it would be good to see your schematic.
Logged

"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?"

Pages: [1]   Go Up
Jump to: