; X-Project-X4-BillyBot28X2+ThisIsAmerica.bas #picaxe 28X2 ; Define the µProcessor IC Type #terminal 9600 symbol RWheel = B.0 symbol LWheel = B.1 symbol LArm = B.2 symbol RArm = B.3 symbol Neck = B.4 symbol BLED = B.5 symbol GLED = B.6 symbol RLED = B.7 symbol i = b0 init: servo RWheel,145 servo LWheel,145 servo LArm,150 servo RArm,150 servo Neck,150 hsersetup B9600_8, %00000 ; 9600 baud, non-inverted polarity ; BEGIN Main Body * * * * * * * * * * * * * * * * * * * * * * * gosub STOPP gosub NeckC gosub RArmC gosub LArmC gosub Police pause 1000 do gosub FWD gosub STOPP pause 500 gosub FWD gosub STOPP gosub RArmU gosub LArmU pause 500 gosub BAK gosub STOPP gosub RArmC gosub LArmC pause 500 gosub green gosub NeckL gosub RArmU gosub Name gosub RArmD gosub NeckR pause 500 gosub blue gosub NeckC gosub SongName gosub NeckR gosub red gosub Speech1 gosub NeckC gosub Police gosub TisAm ;gosub chorus gosub green pause 5000 loop end ; END Main Body * * * * * * * * * * * * * * * * * * * * * * ** ; BEGIN Subroutines * * * * * * * * * * * * * * * * * * * * * * Name: pause 500 ; My name is BillyBot hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 140, 183, 131, 145, 145, 22, 130, 137, 137, 2, 2, 22, 135, 8, 140, 155, 22, 120, 141, 154, 140, 22, 125, 8, 129, 167, 22, 135, 170, 129, 145, 22, 130, 128, 22, 125, 171, 8, 136, 191) gosub NeckC pause 3000 return SongName: ; The song I am going to sing is ; \TH \AW song I am go \IY \NE to sing is \ZZ This is \AW \MM \EH \RR \RR \IY \KE \AW hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 190, 135, 188, 136, 8, 144, 157, 132, 132, 140, 8, 179, 8, 164, 128, 141, 8, 191, 162, 8, 187, 128, 8, 143, 8, 129, 167, 167) pause 3000 gosub RArmU gosub LArmU ; "This is America" hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 130, 8, 169, 8, 129, 187, 22, 125, 8, 129, 167, 22, 120, 135, 22, 130, 140, 131, 22, 135, 148, 148, 128, 22, 130, 194, 22, 125, 135) pause 3000 gosub RArmD gosub LArmD return Speech1: ; I have a PICAXE 28X2 module inside of me hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 130, 157, 183, 8, 132, 166, 154, 128, 22, 125, 198, 129, 194, 6, 22, 120, 132, 194, 187, 22, 125, 8, 7, 191, 7, 147, 131, 141, 7, 191, 128, 22, 120, 154, 4, 191, 22, 125, 131, 131, 195, 187, 22, 120, 8, 191, 162, 22, 125, 140, 135, 22, 115, 8, 165, 145, 129, 141, 8, 187, 155, 176, 140, 128, 128) pause 3500 ; I am programmed in BASIC hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 135, 157, 22, 120, 132, 132, 140, 22, 130, 198, 148, 148, 138, 22, 120, 178, 6, 148, 132, 140, 8, 174, 22, 130, 8, 129, 8, 141, 22, 135, 170, 154, 187, 129, 7, 4, 197) pause 4000 return TisAm: ; "This is America" a song by Walt Perko ;1 From the eastern shores and Plymouth Rock gosub RArmU gosub Right gosub STOPP hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 98, 186, 148, 134, 8, 140, 8, 169, 8, 128, 22, 82, 8, 128, 187, 22, 98, 191, 151, 141, 189, 137, 153, 187, 22, 98, 8, 132, 8, 141, 177, 22, 110, 198, 145, 129, 22, 98, 140, 129, 190, 148, 136, 197) pause 3000 ;2 to the Hawaiian island sunshine hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 98, 191, 8, 138, 190, 135, 8, 184, 135, 22, 131, 185, 155, 132, 141, 155, 145, 132, 141, 22, 110, 187, 133, 141, 22, 98, 189, 157, 141) gosub RArmD gosub Left gosub STOPP pause 3000 ;3 My love for her grows deep and strong gosub LArmU gosub Left gosub STOPP hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 98, 140, 157, 22, 82, 145, 8, 135, 166, 166, 22, 98, 186, 164, 148, 183, 148, 22, 98, 179, 148, 164, 167, 22, 110, 174, 8, 128, 199, 22, 98, 8, 132, 8, 141, 177, 187, 191, 148, 135, 180) pause 3000 ;4 My pride is in her soul hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 131, 140, 155, 22, 147, 198, 148, 155, 176, 22, 147, 6, 8, 129, 167, 22, 131, 6, 8, 129, 8, 141, 6, 22, 123, 183, 148, 6, 22, 131, 8, 188, 8, 137, 8, 145) gosub LArmD gosub Right gosub STOPP pause 3000 gosub chorus pause 1000 ;8 The bill of that we believe gosub RArmU gosub Right gosub STOPP hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 98, 190, 135, 22, 82, 170, 129, 146, 22, 98, 8, 134, 166, 22, 98, 148, 155, 191, 187, 22, 98, 169, 8, 132, 8, 191, 22, 110, 147, 8, 128, 22, 98, 170, 128, 145, 128, 166) pause 3000 ;9 the cause that is our freedom hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 98, 190, 135, 22, 131, 8, 194, 135, 167, 167, 190, 132, 191, 8, 129, 167, 22, 131, 135, 137, 148, 22, 110, 186, 148, 128, 22, 98, 174, 135, 140) gosub RArmD gosub Left gosub STOPP pause 2500 ;10 we hold them sacred in our hearts hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 98, 147, 8, 128, 22, 82, 184, 137, 8, 146, 177, 22, 98, 8, 169, 131, 8, 140, 22, 98, 187, 130, 194, 148, 131, 174, 22, 110, 8, 129, 8, 141, 22, 98, 163, 148, 22, 98, 183, 135, 148, 191, 187) gosub LArmU gosub Left gosub STOPP pause 2500 ;11 ideals that we believe hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 131, 6, 157, 22, 147, 174, 128, 145, 187, 169, 8, 132, 8, 191, 22, 131, 147, 8, 128, 22, 123, 8, 170, 128, 22, 131, 145, 128, 166) gosub LArmD gosub Right gosub STOPP pause 2500 gosub chorus pause 1000 ;12 A shrinking world a growing scheme hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 98, 135, 22, 82, 189, 148, 128, 22, 98, 194, 128, 141, 147, 151, 145, 176, 135, 22, 110, 179, 148, 137, 22, 98, 128, 141, 187, 194, 128, 140) gosub RArmD gosub Left gosub STOPP pause 2500 ;13 democracy surrounds us hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 174, 128, 22, 131, 140, 8, 135, 8, 135, 194, 148, 187, 128, 22, 131, 187, 148, 22, 110, 148, 137, 174, 167, 22, 98, 135, 8, 187) gosub LArmU gosub Left gosub STOPP pause 2500 ;14 freedoms bell will ring again hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 82, 186, 148, 128, 22, 98, 174, 135, 140, 187, 170, 131, 8, 145, 22, 98, 147, 129, 8, 145, 22, 110, 148, 128, 8, 143, 22, 98, 135, 178, 130, 141) gosub LArmD gosub Right gosub STOPP pause 2500 ;15 with liberty enlightening the world hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 131, 147, 129, 8, 8, 190, 145, 129, 170, 148, 22, 147, 191, 128, 22, 147, 129, 141, 145, 155, 22, 131, 191, 141, 128, 141, 22, 123, 190, 135, 22, 131, 8, 147, 151, 145, 176) pause 3000 gosub chorus pause 500 gosub chorus return chorus: ;5 This is America, America gosub RArmU gosub Right gosub STOPP hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 165, 8, 169, 8, 129, 187, 22, 175, 8, 129, 167, 22, 196, 135, 22, 220, 140, 130, 8, 148, 148, 148, 22, 196, 148, 128, 22, 165, 194, 6, 135, 30, 25, 22, 123, 135, 22, 147, 140, 130, 22, 147, 8, 148, 148, 22, 196, 148, 128, 6, 22, 165, 194, 135) pause 3100 ;6 This is America gosub RArmD gosub Left gosub STOPP hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 165, 8, 169, 8, 129, 187, 22, 175, 8, 129, 167, 22, 196, 135, 22, 220, 140, 130, 22, 220, 8, 148, 148, 22, 196, 148, 128, 22, 165, 194, 135) pause 1500 ; 7 and my pride is in her soul gosub LArmD gosub Right gosub STOPP hserout 0,(20, 96, 21, 114, 22, 88, 23, 5, 22, 131, 3, 8, 8, 132, 8, 141, 177, 22, 131, 140, 155, 22, 147, 198, 148, 155, 176, 22, 147, 8, 129, 167, 22, 131, 8, 129, 8, 141, 22, 123, 183, 148, 22, 131, 8, 188, 8, 137, 8, 145) pause 2500 return ; BEGIN LED Subroutines * * * * * * * * * * * * * * * ; LEDs red: low RLED high GLED high BLED return green: high RLED low GLED high BLED return blue: high RLED high GLED low BLED return LEDsOFF: high RLED high GLED high BLED return white: low RLED low GLED low BLED return Police: for i=0 to 14 low RLED high GLED high BLED pause 150 high RLED high GLED low BLED next i return ; END LED Subroutines * * * * * * * * * * * * * * ** ; BEGIN Servo Subroutines * * * * * * * * * * * * * * * * * * * * * * ; Neck NeckC: servopos Neck, 150 return NeckL: servopos Neck, 200 return NeckR: servopos Neck, 100 return ; Arms RArmC: gosub green servopos RArm, 115 return LArmC: gosub green servopos LArm, 200 return RArmU: gosub red servopos RArm, 200 return LArmU: gosub red servopos LArm, 100 return RArmD: gosub blue servopos RArm, 100 return LArmD: gosub blue servopos LArm, 210 return ; Wheels FWD: gosub blue for i = 0 to 9 servopos RWheel, 105 servopos LWheel, 180 pause 20 next i return BAK: gosub red for i = 0 to 9 servopos RWheel, 180 servopos LWheel, 105 pause 20 next i return Left: gosub red for i = 0 to 9 servopos RWheel, 80 servopos LWheel, 80 pause 20 next i return Right: gosub green for i = 0 to 9 servopos RWheel, 185 servopos LWheel, 185 pause 20 next i return STOPP: gosub red servopos RWheel, 145 servopos LWheel, 145 return ; END Subroutines * * * * * * * * * * * * * * * * * * * * * * * * * * ** end