'Freya_8-commands.bas 40x2 Firmware v3 '================================================== 'Note there are ">>" between Acts, one > to get the Act, and one > to get the move '================================================== Commands ======== Primary commands ---------------- 012345678 [Esc].;@()<>+-$?¬ ABEFHIKLMQRSVXZ abeklpqrstuvwxyz ignore comma space @ if first command is @ then autoruns on poweron/reset Acts tested from 1 to 8, then 01 to 07 if recorded from IR Act8 always has an @ to Autorun. 1-8 Act to Record or Play - default page 0 change to Acts page0, after command changes back to Acts page1 ( start of a Do, a jump to an Act will on . continue in the Do, will show its location in EEPROM when played. If a jump is made to an Act which contains another Do then that Do will not be implemented. ) end of a Do Q,q,[Esc] quit current operation - recording, playing, input, flush serial buffer . quit current operation - recording, playing, input if [IR-Power] then flush Serial Buffer ; continue in next Act F Forwards one step B Backwards one step R turn Right one step L turn Left one step H Halt - stand LR from any position with a foot down S Stand, servos off I Initialise leg positions K Kick V voice - react to sensors ON, test G sensors - from IR [9][-] react OFF + react to sensors ON, test WF sensors - from IR [9][+] autosense OFF A be Alive - run commands in Mind E Execute - RUN 3 Z Sleep - kill servos z Sleep - kill servos X,x eXit to enable reprogram ¬ reset PicAxe [U+00AC = not-sign = shift-backtick on UK keyboard] prints differently in different browsers parameter commands {choice {range [default ------------------ 'speed s{1-9 speed su speed up s+ speed up sd speed down s- speed down sm set speedmax for su to speed w0 wait until serial or IR command for Act to resume, no effect if not playing w{1-9 wait x/2 seconds 'voice v{1,b bip v{2,e whee v{3,o whoa v{4,v beep100 v{5,s sshhh v[ tsh 'turn ta Turn Away from leading foot tt Turn To leading foot tm Turn memory, turn same way as last time to Turn Otherway to last time 'do action x a{1,b bip needed FOR IR use a{2,e whee needed FOR IR use a{3,o whoa needed FOR IR use a{4,v beep100 needed FOR IR use a{5,S StampRL a{6,W WaveR a{7,K Kickout a{8,V VerticalSplitsL a{0,A be Alive - run commands in Mind a0 needed FOR IR use a{+,E - experiment a+ needed FOR IR use uf get up from forwards ub get up from backwards uu auto ua auto y 1-9 increments yawn each execution, if yawn=parameter then skip next cmnd 'eyes e{ASCIIchar EyeCode ' k,\ - control 'sensors - test and react $+ test Whiskers & Feelers 'IR [+] react ON then $+, [9][+] react off $- test Ground sensors 'IR [-] autosense ON react ON then $-, [9][-] auto and react off $0 react OFF, autosense OFF 'for IR VCROSS="$" $1 react ON 'for IR VCROSS="$" ${2,a autosense ON 'for IR VCROSS="$" 'U test Ultrasonic sensor (no ultrasonic sensor) $W test Whisker sensors $F test Feelers $G test Ground sensors $T test Tip sensors 'behaviour bS Save current behaviour as default Behaviour b0 reload default behaviour bI Initialise EEPROM, need to RESET or "b0" afterwards bL be Lethargic - as bvl (only two chars for mind cmnds) bN be Normal - as bvn for mind bV be Vigorous - as bvh for mind bv{l,n,h,x vitality - low,normal,high,extreme bl{1-9 move lift x bp{1-9 move pace x bt{1-9 move turn x bd{1-9 toe down offset bf{1-9 Toes front offset bk{0-9 kick bu{0,1 1=auto up, 0=off b$a autosense ON [9][+]=OFF if ON then Ground will be checked after every step and holes reacted to by a jump to Autohole. Then if react is ON other sensors will be checked b$1 sensors reactions ON [9][-]=OFF b$0 sensors autosense and reactions OFF [9][+][9][-] bWS{0-9 Whisker threshold decade - Scale bW{0-9 Whisker threshold digit bFS{0-9 Feeler threshold decade - Scale bF{0-9 Feeler threshold digit ' bU{+{1-9 Ultrasonic AwareAt units 50mm/2" ' bU{-{1-9 Ultrasonic TooNear units 50mm/2" b@ Adjust joints {0-3 select servo / next servo {-,+ adjust position * show current position values C write current position as Centre position Q,[Esc],[.] Quit 'system r{1-8 record 1 of 8 16byte Acts - Esc ; . end record l{1-8 load Act x into current page - Esc ; . end load ?h print Help ?{1-8 print Act ?? print all Acts ?a print all Acts ?b print BeHaves ?p print Pose ?d Dump out all acts to the PC, same as '?' but without the Act and moves numbers. ?# Dump out all acts to the PC as ASCII ?{T,W,F,G print sensor values - Tip,Whisker,Feeler,Ground ?{!.M print- Reacts,Mind X,x eXit to enable reprogram Prog0 - BCDEFGHIKLQRSVWXZ.;^+-$@?012345678 abelrsuvwxz [Esc] spare - AJMNOPTUY cdfghijkmnopqty =:~'"`%&*(){}[]_|<>/\ Prog1 - BFHIKLMRSu$^@ Prog2 - ?a12345678bhpd#TWFG Prog3 - Other responses k - waiting for no IR - ie finger off button --------------------------------------------------------------------------------------------- From Print Help =============== HELP {choice {range [default F B R L H I V S K . Q [Esc] Forward,Back,Right,Left,Halt,Init,Voice,Stop,Kick,stop,Quit.Esc X x Z z eXit,exit,Sleep,sleep @ Autorun marker ; continue in next Slot {1-8 Play Act. (only 7 acts in page0) 0 change to page0 for next command only ( start of Do, not nestable ) end of Do + test Whiskers & Feelers and react - test Ground sensors and react E Experiment - run3 ¬ reset PicAxe r,l,w,v,a,^,t,u,s,b,y,@,? r{1-8 - record Act - Esc ; . end record l{1-8 - load Act, without moving - Esc ; . end record s{1-9 speed {u,+ speed-up {d,- speed-down m set maxspeed to speed w0 wait any key or IR {1-8 wait 1/2 secs vb bip e whee o whoa v beep50 s sshhh v[ tsh ta Turn Away from leading foot t Turn To leading foot m Turn memory, turn same way as last time o Turn Otherway to last time a,^ Subroutines {1,b bip {2,e whee {3,o whoa {4,v beep100 {5,S StampRL {6,W WaveR {7,K Kick {8,V VertSplitL {9,u GetUp {0,A - be Alive - run commands in Mind a0 needed FOR IR use {+,E - experiment a+ needed FOR IR use uf standUp from forwards b standUp from backwards u,a auto standUp e{ASCIIchar EyeCode y{1-9 increments yawn each execution, if Playing if yawn=paramter then skip next cmnd $ test sensors and react + test Whiskers & Feelers 'IR [+] react ON then $+, [9][+] react off - test Ground sensors 'IR [-] react ON then $-, [9][-] auto and react off 0 reacts OFF, autosense OFF 'for IR VCROSS="$" 1 reacts ON 'for IR VCROSS="$" <2,a> autosense ON W Whiskers F Feelers G Ground sensors T Tip sensor bS Save current behaves 0 load behaves I Initialise EEPROM l{1-9 lift p{1-9 pace t{1-9 turn, may fall if 9 d{0-9 toe Down offset f{0-9 toe Front offset k{0-9 Kick u{0,1 autoUp off,on $a - autosense ON [9][+]=OFF $1 - sensors reactions ON [9][-]=OFF $0 - sensors autosense and reactions OFF [9][+][9][-] WS{0-9 Whisker threshold decade {0-9 Whisker threshold digit FS{[0-9 Feeler threshold decade {0-9 Feeler threshold digit @ Adjust joints [/]next,[*]print,[-][+]adjust,[C]centre,[Q] ?{h,^,?,{1-8,p,b,d,# print Help,Subs,Acts,Act,Pose,BeHaves,dump-Acts,#Acts ?{W,F print Whiskers,Feelers, last reading ?{T,G print Tip,Ground ?{!.M print- Reacts,Mind 'REACTIONS 'obstacles OLR, s-BBtatm. OL_, s-BRR. O_R, s-BLL. 'holes HLR, s-BBBBtatm. HL_, s-BRRR. H_R, s-BLLL. HBLR, s-FF. HBL_, s-FFR. HB_R, s-FFL. --------------------------------------------------------------------------------------------- --- Future ---------------------------------------- bR - 0-8 set autorun Act, 0 no autorun, save in EEPROM, 249 is spare vl - beep LOW vm - beep medium vh - beep HIGH vtx - play tune x =01-08,1-8 v - voice sound x h<1-8> - set heading - needs compass tl - turn towards light td - turn towards dark th - turn TO heading - needs compass {X - Xplore() until 'Q' or reset // Wander() } clashes with eXit to program A - Alive, explore with RANDOM moves until Q [f+][fx][1-8] IR only - LCD Act ' start/stop comment - GetCmnd should process this - saves time r<1-8> |'*r0<1-8> - record 1 of 16 16byte Acts l<1-8> |'*l0<1-8> - record 1 of 16 16byte Acts behaviour rules =============== b#<1-9> - set robot-group b# - set robot-name #<1-8> - all messages are for robot-group, robots silent # - all messages are for robot-name #0 - all messages are broadcast, default on poweron, robots silent ## - all robots stop and send messages #> - resume Act #< - do default Act #. - end a # session bWF<1-8> - Act TO be done on hole-tests left & right true bWR<1-8> - Act TO be done on hole-test right true bWL<1-8> - Act TO be done on hole-test left true bGF<1-8> - Act TO be done on Whisker-tests left & right true bGR<1-8> - Act TO be done on Whisker-test right true bGL<1-8> - Act TO be done on Whisker-test left true 'bU+<{0},1-8> - Act TO be done on Ultrasonic distance < aware at 'bU-<{0},1-8> - Act TO be done on Ultrasonic distance < too near ------------- [9][fx[fx]][1-8] - set robot's responsive robot number [9][fx][1-8] - set responsive robot group number [9][fx][0] - set response TO broadcast [9][f|][-][^][1-8] - Act TO be done on Hole-tests left & right true [9][f|][-][>][1-8] - Act TO be done on Hole-test right true [9][f|][-][<][1-8] - Act TO be done on Hole-test left true [9][f|][+][^][1-8] - Act TO be done on Whisker-tests left & right true [9][f|][+][>][1-8] - Act TO be done on Whisker-test right true [9][f|][+][<][1-8] - Act TO be done on Whisker-test left true [9][^] -> 'su' - speed up [9][v] -> 'sd' - speed down External EEPROM =============== {0 - sets epage0 IF external EEPROM} { # - READ decimal number, FOR extended Acts, folders, Byte parameters etc.} clash Dump# f<1-8> - current folder OR frame FOR Acts FOR extended EEPROM (256 Byte folders/frames) behave bv=vitality 0 - 15, with 10 100% behave {b-name|address} posture[list of absolute values], 0=>ignore, 255 use variable pose {p-name|address} [list of absolute values], act {a-name|address} do {d-name|address} name is ignored when read, start of name should be p-,a-,d- etc so reader routine knows how to read address aa to zz (leaves AA to ZZ free) each slot 32 bytes, even with 12 byte name and 2 byte address still leaves 18 bytes for moves slot - name:address moves. name is at start so can be sorted alphabetically for humans aa-zz => 26*26 *32 bytes =676 *32 =21,632 could have 48 bytes per slot =>32,448 so can use 32k =32768 leaves 320 bytes ------------------------------------------- old ideas NOT needed -------------------- c<1-8><1-8> - copy one Act TO another Act Slot