Shop OBEX P1 Docs P2 Docs Learn Events
Stupid, but Patriotic project for her majesty's jubilee — Parallax Forums

Stupid, but Patriotic project for her majesty's jubilee

BritannicusBritannicus Posts: 98
edited 2012-06-01 18:16 in Robotics
This project only started on Monday - and here it is on Friday finished ....

My son came home from school "Dad - we've got a competition for the Queen's Jubilee" - We've got to make a crown.... there is a prize for the most ingenious! ( for those non members of the commonwealth it's the 60th aniversary of the Queens coronation - and we get a public holiday).

So we thought about what we could do ... and this tasteful and understated little confection was the result.

The final result utilises some old christmas lights rigged to a separate 9V battery and, for speed of development a BOE with an onboard 9V

1/ 2 Servos linked to servo ports 14 and 15 - one operates a home-made continous rotation servo and the other a mini servo - these drive the waving hand and the rotating union jacks

2/ A speaker between pin 9 and earth programme

3/ finally a switch rigged to set pin 3 as high or low

The programme is simple enough - ( thanks Duane Degne by the way for the de-bugging help) :thumb: :thumb:

My code goes like this :

1/ sits in a loop waiting for a high on pin 3

2/ Goes to a loop to play "God save the queen"

3/ .finally activates the servos before returning to the loop. Warning this does devour 9v batteries :smile:

In the unlikely circumstance that anyone should wish to repeat such an exercise here's my code (extensively poached and adapted from "what's a microcontroller" )

' {$STAMP BS2}' {$PBASIC 2.5}' Play the first few notes from god save the queen.' speaker connects to pin 9 and Vss DEBUG "Program Running!"Notes DATA "C","C","D","B","C","D","P","E","E","F","E","D","C","P","D","C","B","C","Q"Durations DATA 4,4,4,2,6,6,8,4,4,4,2,6,6,8,4,4,4,4WholeNote CON 2000index VAR Byteoffset VAR NibnoteLetter VAR BytenoteFreq VAR WordnoteDuration VAR Wordcounter VAR Wordwave VAR WordIN3=0'SITS HERE UNTIL  IN3 IS POSITIVEDODEBUG ? IN3IF (IN3=1)THENDEBUG  "OFF i GO"GOTO ACTIONELSEPAUSE 100ENDIFLOOPACTION:' FIRST SECTION PLAYS GOD SAVE THE QUEENDO UNTIL noteLetter = "Q"READ Notes + index, noteLetterLOOKDOWN noteLetter, [ "A", "b", "B", "C", "d","D", "e", "E", "F", "g","G", "a", "P", "Q" ], offsetLOOKUP offset, [ 1760, 1865, 1976, 2093, 2217,2349, 2489, 2637, 2794, 2960,3136, 3322, 0, 0 ], noteFreqREAD Durations + index, noteDurationnoteDuration = WholeNote / noteDurationFREQOUT 9, noteDuration, noteFreqindex = index + 1LOOPnoteLetter = "A"index=0'SECOND SECTION WAVE THE HAND use port 14   - use port 15 for the continuous servoFOR wave = 1 TO 4DEBUG "Counterclockwise 10 o'clock", CRFOR counter = 1 TO 50PULSOUT 14, 1000PULSOUT 15, 1000PAUSE 20NEXTDEBUG "Clockwise 2 o'clock", CRFOR counter = 1 TO 50PULSOUT 14, 500PULSOUT 15, 1000PAUSE 20NEXTDEBUG "Center 12 o'clock", CRFOR counter = 1 TO 50PULSOUT 14, 750PULSOUT 15, 750PAUSE 20NEXTDEBUG "All done."NEXTRETURN

Comments

  • ercoerco Posts: 20,256
    edited 2012-06-01 06:20
    Brilliant, and swift execution! Hope he wins, Guv'nah! :)
  • ElectricAyeElectricAye Posts: 4,561
    edited 2012-06-01 07:53
    It's fantastic! I love it. The royal hand wave just cracked me up. Good luck on the contest.


    LG_19445110.jpg
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-01 08:30
    'Very nicely conceived and executed! Rule, Britannicus! Rule that contest!

    -Phil
  • davejamesdavejames Posts: 4,047
    edited 2012-06-01 09:22
    That's awesome, cousin! Just awesome!

    Good luck!
  • Jen J.Jen J. Posts: 649
    edited 2012-06-01 09:28
    Most excellent!
  • BritannicusBritannicus Posts: 98
    edited 2012-06-01 11:19
    Cheers Guys - thanks for the support !! -

    James came back from the competition - we won ! is there no end to the versitility of the basic STAMP ?!


    :thumb::thumb::thumb::thumb:

    A clean sweep actually as my wife won the cake competition - way to go Ann ! ( Jolly good show I should say ! )

    DSCF3882.JPG


    Pretty good stuff eh! - tasted good too
    1024 x 768 - 111K
    570 x 427 - 80K
  • Jen J.Jen J. Posts: 649
    edited 2012-06-01 14:05
    Congrats! What a talented (and patriotic) family!
    Enjoy your long weekend.
  • PublisonPublison Posts: 12,366
    edited 2012-06-01 15:42
    Two first places! Way to go! Congrats. You should expect an invitation to Buckingham Palace any day now. :)

    Jim
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-01 15:53
    Congrats! And enjoy the rest of the celebration! (If her mum was any indication there will be yet more to come. Charles will just have to wait. :) )

    -Phil
  • ercoerco Posts: 20,256
    edited 2012-06-01 18:16
    Big congrats and bonus points for using our beloved BS2 on "your side" of the pond. The PicAxe is a competing UK product. In their forum, it's easy to get the impression that all Brits only use Rev-Ed products! :)
Sign In or Register to comment.