' bot ' setting up the variable dim cmd,device,Lservo,Rservo,Lrange,Rrange dim x,y PULSEINTIMEOUT = 252 const Lservoport 0 'port for servo const Rservoport 1 'port for servo const servof 30 ' speed of servo const servob 220 ' speed of servo output Lservoport 'setting up the port of output output Rservoport 'setting up the port of output loop: irin 5,cmd,device 'receiving the infomation from the TV remote ' to control the servo start: if cmd = 0 then goto loop endif lookdown cmd,cmd,16,17,18,19 branch cmd,fwd,bkwd,right,left goto loop ' this is to make the bot go forward fwd: for x =1 to 30 servo Lservoport,servof servo Rservoport,servob next goto loop ' this is to make the bot go backward bkwd: for x =1 to 30 servo Lservoport,servob servo Rservoport,servof next goto loop ' this is to make the bot turn left left: for x =1 to 30 servo Lservoport,servof servo Rservoport,servof next goto loop ' this is to make the bot turn right right: for x =1 to 30 servo Lservoport,servob servo Rservoport,servob next goto loop