A PIC16F84 type microcontroller is used with a 4 MHz crystal
‘
‘ Author: Dogan Ibrahim
‘ Date: January, 2005
‘ Compiler: PicBasic
‘
‘ Modifications
‘ =======
‘
‘************************************************* ************************
‘
‘ Symbols
‘
Symbol PORTB = $06 ‘ PORTB address
Symbol TRISB = $86 ‘ TRISB address
Symbol J = B0
POKE TRISB, 0 ‘ PORTB is output
‘
‘ Move the robot forward for 4 seconds
‘
FOR J = 1 TO 174
PULSOUT 0, 170
PULSOUT 1, 130
PAUSE 20
NEXT
‘
‘ Wait for 5 seconds
‘
PAUSE 5000
‘
‘ Move the robot backward for 3 seconds
‘
FOR J = 1 TO 130
PULSOUT 0, 130
PULSOUT 1, 170
PAUSE 20
NEXT J
END
Bookmarks