'>Hxtr1-1.BSx '============================================================== 'Milford Instruments http://www.milinst.com 'Hextor Design, Bug Commander - Behavioural Operating System 'and the Behavioural Controller programs by David Buckley '================================================================ '{$stamp BS2Sx} DEBUG "prog1" '============================================================== 'Hxtr1-0.BSx - main 'Hxtr1-1.BSx - Activity sequencer 'Hxtr1-2.BSx - US Behaviour 'Hxtr1-3.BSx - Direct Control 'Hxtr1-4.BSx - Prog4 'Hxtr1-5.BSx - Prog5 'Hxtr1-6.BSx - Prog6 'Hxtr1-7.BSx - Utils- LCD menu and IR remote 'Hxtr1-Doc.BSx - Meta Commands and Program Headers '============================================================== ' 'New '--- 'Introduction of a Meta command 'b' to test the bump feelers 'and act on the result. See below at Meta commands. 'Gosub usercmnd at start of dosequence because if an activity 'didn't send a BOS cmnd the buttons and IR were never read! ' 'Introduction of a meta command 'J' to allow a jump to another 'program without any return address being put on the stack. ' 'For consistency with meta command usage in US behaviours where 'meta command 'a' results in the current routine being placed 'on the stack, here the command 'a' has been changed to 'j' for 'jump. ' 'CommonRam: #2 'Meta command: J 'Constants: bl br bb 'Variables: feel ' btn was in low nib and overwrote btnstate ' flags, irwatch now Firwatch 'Routine: in dosequence gosub usercmnd added at start ' dosequence modified for J and j 'Sequences: Wiggle2 amended with i '============================================================== 'History '------- '15Aug05 FokLEDs,Fokfeelers,Fokus renamed FuseLEDs,Fusefeelers,FuseUS '============================================================== 'Direct Control 'turns on servo power and exits with servo power on 'BOSbusy goes low immediately, doesn't wait for move to finish '$speed;$servo - high nibble and low nibble respectively ' BOScmnd,arg1.arg2 ' 0,$speed;$servo,position ' 1,$XX,$servo,X ->P actual servo position ' 2,$XX,$servo,X ->S servo status, bit1-on bit0-done ' 3,X,X ->hiF,then loF two bytes all servo moved status ' 4,X,X ->hiR,then loR two bytes all servo on/off status ' 5,$XX;$servo,X stop pulsing servo ' '-------- Legs & Logical-Servos -------- ' Plan view of Hextor S - Servo(0 - 13) L - Legs(1 - 6) ' S L L S ' ( ) gripper 13 ' | | lift 12 ' L---F---R LEG NUMBERS ' 1,0 | 1 2 | 6,7 1=LF 2=RF ,L - left, R - Right ' 3,2 | 3 4 | 8,9 3=LM 4=RM ,M - mid, F - Front ' 5,4 | 5 6 | 10,11 5=LB 6=RB ,B - Back ' \-------/ ' 'Servo position ' f - forward m - middle b - backward 'Left Lf=255 Lm=127 Lb=0 'Right Rf=0 Rm=127 Rb=255 ' ' d - Down u - Up 'Left Ld=0 Lu=255 'Right Rd=255 Ru=0 '-------------------------------------------------------------- 'Sequences in DATA statments '--------------------------- 'Meta commands - '"z" terminator for sequences '"J",,