; testing lang ito servo(255) ; Forward motion ;only when button 0 is pressed button(0) ; leg 1 move(1,-60,2) wait(0.2) move(5,60,2) wait(0.2) move(2,-40,2) wait(0.2) move(6,40,2) wait(0.2) move(1,0,) wait(0.2) move(5,0,) wait(0.6) ; leg 2 move(3,-60,2) wait(0.2) move(7,60,2) wait(0.2) move(4,-40,2) wait(0.2) move(8,40,2) wait(0.2) move(3,0,) wait(0.2) move(7,0,) wait(0.6) ; move forward slowly move(2,30,7) move(4,30,7) move(6,-30,7) move(8,-30,7) wait(1.5) bend ;reverse motion ; when buton 3 is pressed button(3) ; leg 1 move(1,-60,2) wait(0.2) move(5,60,2) wait(0.2) move(2,40,2) wait(0.2) move(6,-40,2) wait(0.2) move(1,0,) wait(0.2) move(5,0,) wait(0.6) ; leg 2 move(3,-60,2) wait(0.2) move(7,60,2) wait(0.2) move(4,40,2) wait(0.2) move(8,-40,2) wait(0.2) move(3,0,) wait(0.2) move(7,0,) wait(0.6) ; move forward slowly move(2,-30,7) move(4,-30,7) move(6,30,7) move(8,30,7) wait(1.5) bend ; twist left button(1) call(1) move(2,60,3) move(4,60,3) move(6,60,3) move(8,60,3) bend ; twist right button(2) call(1) move(2,-60,3) move(4,-60,3) move(6,-60,3) move(8,-60,3) bend ; exercise when button 5 is pressed button(5) move(2,-30,4) move(4,-30,4) move(6,-30,4) move(8,-30,4) wait(1) move(2,30,4) move(4,30,4) move(6,30,4) move(8,30,4) wait(1) bend end ; neutral position sub(1) move(1,-30,1) move(3,-30,1) wait(0.2) move(2,0,1) move(4,0,1) wait(0.4) move(1,0,) move(2,0,) wait(0.2) move(7,30,1) move(5,30,1) wait(0.2) move(6,0,1) move(8,0,1) wait(0.4) move(7,0,) move(5,0,) wait(0.2) return