#

 
  The above six legged walking robot uses three servos. One of the servos is used to rock the body back and forth and in turn lifts up legs 1,3,5 or legs 2,4,6. The other two servos are used to swing legs 1,3 on the left side or 4,6 on the right side forward and backward. 

By performing the sequences in the above-right figure, walking movements such as forward, reverse, spin left, spin right can be accomplished. 

The code below demonstrates the walking sequence and how the IR feature in the SV200C can be used. 
Dim BumpL as Bit 0 of RC        'Sensor 1 
Dim BumpR as Bit 1 of RC        'Sensor 2 
Dim I as Byte   'Declare Variable 

Const StepDelay = 300 
Const LeftFwd = 70 
Const LeftBck = 180 
Const RightFwd = 180 
Const RightBck = 70 
Const ShiftLeft = 95 
Const ShiftRight = 145 

fIRenable = 1   'Enable IR receiver 
Main: 
  if fIRaval then       'IR received? 
    If IRreg = "A" then Call WFwd  'Ch Up 
    If IRreg = "B" then Call WRev  'Ch Dwn 
    If IRreg = "C" then Call WLeft   'Vol Up 
    If IRreg = "D" then Call WRight 'Vol Dwn 

    If IRreg = "F" then Call Auto     'Power 

    fIRaval = 0 'Clear Flag 
  End if 
Goto Main 

Servo3 = ShiftLeft      'Step1 
  Delay StepDelay 
  Servo1 = LeftFwd      'Step2 
  Servo2 = RightBck 
  Delay StepDelay 
  Servo3 = ShiftRight   'Step3 
  Delay StepDelay 
  Servo1 = LeftBck      'Step4 
  Servo2 = RightFwd 
  Delay StepDelay 
End Sub 

Sub WBck 
  Servo3 = ShiftLeft    'Step1 
  Delay StepDelay
  Servo1 = LeftBck      'Step4 
  Servo2 = RightFwd 
  Delay StepDelay       'Step3 
  Servo3 = ShiftRight 
  Delay StepDelay 
  Servo1 = LeftFwd      'Step2 
  Servo2 = RightBck 
  Delay StepDelay 
End Sub 

Sub WLeft 
  Servo3 = ShiftLeft    'Step1 
  Delay StepDelay 
  Servo1 = LeftBck      'Step2 
  Servo2 = RightBck 
  Delay StepDelay 
  Servo3 = ShiftRight   'Step3 
  Delay StepDelay 
  Servo1 = LeftFwd      'Step4 
  Servo2 = RightFwd 
  Delay StepDelay 
End Sub 

Sub WRight 
  Servo3 = ShiftLeft    'Step1 
  Delay StepDelay 
  Servo1 = LeftFwd      'Step4 
  Servo2 = RightFwd 
  Delay StepDelay 
  Servo3 = ShiftRight   'Step3 
  Delay StepDelay 
  Servo1 = LeftBck      'Step2 
  Servo2 = RightBck 
  Delay StepDelay 
End Sub 

Sub Auto