Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Macro for a BB-8 to dance to the Happy Birthday song.
# Happy Birthday dear robots.
#
# Music: https://www.youtube.com/watch?v=4MpMOWldf1c
# Launch code: https://github.com/pwnall/node-sphero-pwn-cli
flag $brakeOnEnd :on
flag $exclusiveDrive :on
flag $markerOnEnd :on
flag $stopOnDisconnect :on
let $power 63
let $delay1 165
let $delay2 330
let $delay3 495
let $delay4 660
let $delay8 1320
repeat 4
rgb 255 135 0
delay $delay2
rgb 0 0 0
delay $delay2
endrepeat
let $main :forward
let $opposite :reverse
repeat 2
rgb 255 75 0
motor $main $power $opposite $power
delay $delay3
motor $opposite $power $main $power
delay $delay1
rgb 255 0 120
motor $main $power $opposite $power
delay $delay4
rgb 255 75 0
motor $opposite $power $main $power
delay $delay4
rgb 255 0 80
motor $main $power $opposite $power
delay $delay4
rgb 145 0 255
motor $opposite $power $main $power
delay $delay8
endrepeat
rgb 255 75 0
motor $main $power $opposite $power
delay $delay3
motor $opposite $power $main $power
delay $delay1
rgb 255 0 120
rgbfade 255 75 0 $delay4
motor $main $power $opposite $power
delay $delay4
rgb 255 75 0
rgbfade 255 255 0 $delay4
motor $opposite $power $main $power
delay $delay4
rgb 255 255 0
rgbfade 90 255 0 $delay4
motor $main $power $opposite $power
delay $delay4
rgb 90 255 0
rgbfade 0 180 255 $delay4
motor $opposite $power $main $power
delay $delay4
rgb 0 180 255
rgbfade 120 0 255 $delay8
motor $main $power $opposite $power
delay $delay8
rgb 255 75 0
motor $main $power $opposite $power
delay $delay3
motor $opposite $power $main $power
delay $delay1
rgb 255 0 120
motor $main $power $opposite $power
delay $delay4
rgb 255 75 0
motor $opposite $power $main $power
delay $delay4
rgb 255 0 80
motor $main $power $opposite $power
delay $delay4
rgb 145 0 255
motor $opposite $power $main $power
delay $delay8
motor :off 0 :off 0
stabilization :on
roll 0 60
delay 1000
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.