' BFF_RBT_SLAVE.bas ' Copyright 2008 BFF Design Ltd ' ' Ian Hopper (BFF Design Ltd) Sept 2008 ' http://buggies.builtforfun.co.uk - email Ian@builtforfun.co.uk ' ' For DIY Wi-Fi Remote Control Robot ' ' --------------------------- ' ' For 28X1 chip using its internal resonator.......... ' ' Declarations ' ' symbol tilt = b6 symbol pan = b7 ' ' 'Set the chip frequency setfreq m4 'Set start values for servo positions tilt = 140 pan = 140 'Move the servos to mid servo 6, tilt servo 4, pan MainLoop: pause 50 'Set the servo movement if pin0 = 1 then tilt = tilt + 2 MIN 90 MAX 190 servopos 6, tilt else if pin1 = 1 then tilt = tilt - 2 MIN 90 MAX 190 servopos 6, tilt end if pause 50 if pin2 = 1 then pan = pan + 2 MIN 90 MAX 190 servopos 4, pan elseif pin3 = 1 then pan = pan - 2 MIN 90 MAX 190 servopos 4, pan end if goto MainLoop