Shop OBEX P1 Docs P2 Docs Learn Events
My BS2 Xylophone robot. — Parallax Forums

My BS2 Xylophone robot.

BergamotBergamot Posts: 185
edited 2006-05-15 17:15 in Robotics
A few months ago, I saw a video for a robot called the Conraptophone, and it inspired me to try to build my own. While the original was pretty cool, I thought I could do better.

Well, I think I did! (video)

schematic.gif



As you can see, I ran out of room on the BOE breadboard, so I bought a bigger one to use for the control buttons. The black button wipes the song in memory, and the red buttons add new notes to the end of the song. When the BS2 is reset, it plays whatever song is in memory.

Since making the video, I tweaked the timings a bit to let it go faster.

Current plans include a backspace key and a "rest" key, and maybe some potentiometers for tuning, but I'm already using 13 out of 16 pins freaked.gif , so first I'll probably have to rig up some way to reduce the number of pins needed to control the buttons.

Post Edited (Bergamot) : 5/10/2006 6:27:55 AM GMT

Comments

  • GadgetmanGadgetman Posts: 2,436
    edited 2006-05-10 08:56
    Looks nice.

    One thing though, is that yuo might want to place the two 'arms' closer together.
    That way you get a different arch which will make it possible to hit closer to the center of the outermost notes.

    As for I/O-pins, you may want to splitting the keyboard into 'rows' and scan them that way.
    That should save a few pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • steve_bsteve_b Posts: 1,563
    edited 2006-05-10 14:01
    Very neat design!
    Something kids would love!

    Can you build "live" button actions? Like an organ-like device.

    good job!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-10 14:12
    Steve,

    ·· In the video it shows him pushing buttons for the corresponding note after the main sequence is done so that should be supported.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-05-10 22:39
    · I like it, I like it a lot.

    · Where's the program?
  • BergamotBergamot Posts: 185
    edited 2006-05-11 00:20
    Oops, must have forgotten to post the code:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    
    'Declare Variables
    
    i           VAR Byte
    songLength  VAR Word
    currentNote VAR Word
    
    servo12pos  VAR Word
    servo13pos  VAR Word
    servo14pos  VAR Word
    servo15pos  VAR Word
    
    
    'Declare Constants
    
    servo12rest  CON 775
    servo12note1 CON 835
    servo12note2 CON 794
    servo12note3 CON 749
    servo12note4 CON 708
    
    servo14rest  CON 590
    servo14note1 CON 653
    servo14note2 CON 611
    servo14note3 CON 570
    servo14note4 CON 528
    
    servo13rest  CON 570
    servo13down  CON 537
    
    servo15rest  CON 540
    servo15down  CON 507
    
    'Begin Program
    
    READ 0, Word songLength
    
    counter VAR Word
    counter = 2
    
    servo12pos = servo12rest
    servo13pos = servo13rest
    servo14pos = servo14rest
    servo15pos = servo15rest
    
    FOR i = 1 TO 10
       PULSOUT 12, servo12pos
       PULSOUT 13, servo13pos
       PULSOUT 14, servo14pos
       PULSOUT 15, servo15pos
    
       PAUSE 20
    NEXT
    
    DO
       IF (counter) <= (songLength * 2)  THEN
    
          READ counter, Word currentNote
    
          IF currentNote > 400 THEN
             IF currentNote < 1000 THEN
                servo12pos = currentNote
             ELSEIF currentNote < 2000 THEN
                servo14pos = currentNote - 1000
             ENDIF
          ENDIF
    
          FOR i = 1 TO 10
             PULSOUT 12, servo12pos
             PULSOUT 13, servo13pos
             PULSOUT 14, servo14pos
             PULSOUT 15, servo15pos
    
             PAUSE 10
          NEXT
    
          IF currentNote > 400 THEN
             IF currentNote < 1000 THEN
                servo13pos = 537
             ELSEIF currentNote < 2000 THEN
                servo15pos = 507
             ENDIF
          ENDIF
    
          FOR i = 1 TO 5
             PULSOUT 12, servo12pos
             PULSOUT 13, servo13pos
             PULSOUT 14, servo14pos
             PULSOUT 15, servo15pos
    
             PAUSE 20
          NEXT
    
          servo13pos = servo13rest
          servo15pos = servo15rest
    
          FOR i = 1 TO 5
             PULSOUT 12, servo12pos
             PULSOUT 13, servo13pos
             PULSOUT 14, servo14pos
             PULSOUT 15, servo15pos
    
             PAUSE 20
          NEXT
    
          counter = counter + 2
    
       ENDIF
    
       IF IN0 = 1 AND songLength < 600 THEN
          songLength = songLength + 1
          WRITE 0, Word songLength
          WRITE (songlength * 2), Word (1000 + servo14note1)
       ENDIF
    
       IF IN1 = 1 AND songLength < 600 THEN
          songLength = songLength + 1
          WRITE 0, Word songLength
          WRITE (songlength * 2), Word (1000 + servo14note2)
       ENDIF
    
       IF IN2 = 1 AND songLength < 600 THEN
          songLength = songLength + 1
          WRITE 0, Word songLength
          WRITE (songlength * 2), Word (1000 + servo14note3)
       ENDIF
    
       IF IN3 = 1 AND songLength < 600 THEN
          songLength = songLength + 1
          WRITE 0, Word songLength
          WRITE (songlength * 2), Word (1000 + servo14note4)
       ENDIF
    
       IF IN4 = 1 AND songLength < 600 THEN
          songLength = songLength + 1
          WRITE 0, Word songLength
          WRITE (songlength * 2), Word servo12note1
       ENDIF
    
       IF IN5 = 1 AND songLength < 600 THEN
          songLength = songLength + 1
          WRITE 0, Word songLength
          WRITE (songlength * 2), Word servo12note2
       ENDIF
    
       IF IN6 = 1 AND songLength < 600 THEN
          songLength = songLength + 1
          WRITE 0, Word songLength
          WRITE (songlength * 2), Word servo12note3
       ENDIF
    
       IF IN7 = 1 AND songLength < 600 THEN
          songLength = songLength + 1
          WRITE 0, Word songLength
          WRITE (songlength * 2), Word servo12note4
       ENDIF
    
       IF IN8 = 1 THEN
          WRITE 0, Word 0
          songLength = 0
          counter = 2
    
          servo12pos = servo12rest
          servo13pos = servo13rest
          servo14pos = servo14rest
          servo15pos = servo15rest
    
          FOR i = 1 TO 10
             PULSOUT 12, servo12pos
             PULSOUT 13, servo13pos
             PULSOUT 14, servo14pos
             PULSOUT 15, servo15pos
    
             PAUSE 20
          NEXT
    
    
       ENDIF
    
    LOOP
    
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-11 02:52
    You should edit your message and attach the code so it can be downloaded in original form.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • SuperwormsSuperworms Posts: 118
    edited 2006-05-11 20:53
    could you post sone pics
  • LSBLSB Posts: 175
    edited 2006-05-12 00:14
    http://www.kronosrobotics.com/an155/AAN155.shtml is a link to a circuit diagram and explanation of how to use RCTIME and vararious resistors to put multiple buttons on 1 I/O port. I've added six buttons this way. Simple, cheap, and easily adaptable to your projuct.

    Mark
  • SN96SN96 Posts: 318
    edited 2006-05-13 12:00
    Very well done! It was entertaining to watch!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    ·
  • Joe MJoe M Posts: 45
    edited 2006-05-15 17:15
    Yeah, this is awesome! cool project.

    -Joe
Sign In or Register to comment.