Shop OBEX P1 Docs P2 Docs Learn Events
Singing BoeBot — Parallax Forums

Singing BoeBot

GaryBGaryB Posts: 9
edited 2008-07-02 19:20 in Robotics
One of my 13 year old students, Jessa Karlberg, programmed her BoeBot, Roger, to sing Ode to Joy. I've attached the program for those who are interested.

Gary Brandt

Comments

  • um..., Hium..., Hi Posts: 64
    edited 2006-02-22 04:49
    hey that is preatty cool i have been working on getting master of pupets by metalica on mine for a while but getting the note lenthgs correct is tricky!
  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-02-24 21:55
    I just made this code to make your bot sing. Type in numbers 1-7 for some notes. The only scematic you need is a peizospeaker attached to P4 and wired to end at the second spot from the right on the Vss row.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    counter VAR Word
    frequency VAR Word
    DO
    DEBUG "Enter note: "
    DEBUGIN DEC frequency
    SELECT frequency
    CASE 1
    FOR counter = 1 TO 1
     FREQOUT 4, 1000, 2000
    NEXT
    CASE 2
    FOR counter = 1 TO 1
     FREQOUT 4, 1000, 2500
    NEXT
    CASE 3
    FOR counter = 1 TO 1
     FREQOUT 4, 1000, 3000
    NEXT
    CASE 4
    FOR counter = 1 TO 1
     FREQOUT 4, 1000, 3500
    NEXT
    CASE 5
    FOR counter = 1 TO 1
     FREQOUT 4, 1000, 4000
    NEXT
    CASE 6
    FOR counter = 1 TO 1
     FREQOUT 4, 1000, 4500
    NEXT
    CASE 7
    FOR counter = 1 TO 1
     FREQOUT 4, 1000, 5000
    NEXT
    ENDSELECT
    LOOP
    
  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-02-24 22:32
    here an updated version of the above:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    counter VAR Word
    frequency VAR Word
    

    DO
    DEBUG "Enter note: "
    DEBUGIN DEC frequency
    SELECT frequency
    '-----a-----
    CASE 1
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 930
    NEXT
    '-----b flat-------
    CASE 2
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 970
    NEXT
    '-----b------
    CASE 3
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 1030
    NEXT
    '-----c-----
    CASE 4
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 1100
    NEXT
    '-----c sharp-----
    CASE 5
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 1180
    NEXT
    '-----d-----
    CASE 6
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 1240
    NEXT
    '-----e-----
    CASE 7
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 1400
    NEXT
    '-----f-----
    CASE 8
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 1500
    NEXT
    '-----f sharp-----
    CASE 9
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 1590
    NEXT
    '-----g------
    CASE 10
    FOR counter = 1 TO 1
     FREQOUT 4, 500, 1630
    NEXT
    

    ENDSELECT
    LOOP
    
  • TiboTibo Posts: 81
    edited 2006-02-25 09:12
    Hi, just a question : why 'for 1 to 1' ?
  • SciTech02SciTech02 Posts: 154
    edited 2006-03-09 20:54
    I've made a Twinkle twinkle little star song program, but I'm not sure the notes are correct though.
  • nobodynobody Posts: 1
    edited 2008-07-02 05:28
    The notes listed below are not correct...
    The actual frequencies are:
    440-A
    446-A# or Bb
    493-B
    523-C
    554-C# or Db
    587-D
    622-D# or Eb
    659-E
    698-F
    740-F# or Gb
    784-G
    830-G# or Ab
    880-A

    To go up or down an octave from the above notes you double or half the frequency. As you can see from the A's I listed (440 hz and 880 hz), this formula works.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-07-02 18:19
    You also might want to consider using the Parallax SoundPAL:

    http://forums.parallax.com/showthread.php?p=687747

    It's fairly easy to implement and small for a BOEBOT too.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-07-02 19:20
    The SoundPAL product page is here.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
Sign In or Register to comment.