hi
i'm using the pic16f877a for my line follower. servo motor is used to control the wheel. i'm using 3 IR to detect the black line....so how i need to write the codes using picbasic??
'porta.0 is Right Motor
'porta.1 is Left Motor
'portb.0 is Right Sensor
'portb.1 is Center Sensor
'portb.2 is Left Sensor
'white line = 1
'black line = 0
'L C R
'0 0 0 MF
'0 0 1 TL
'0 1 0 MF
'0 1 1 TL
'1 0 0 TR
'1 0 1 MF
'1 1 0 TR
'1 1 1 SC
If (RS = 0) and (CS = 0) and (LS = 0) Then MF
If (RS = 1) and (CS = 0) and (LS = 0) Then TL
If (RS = 0) and (CS = 1) and (LS = 0) Then MF
If (RS = 1) and (CS = 1) and (LS = 0) Then TL
If (RS = 0) and (CS = 0) and (LS = 1) Then TR
If (RS = 1) and (CS = 0) and (LS = 1) Then MF
If (RS = 0) and (CS = 1) and (LS = 1) Then TR
If (RS = 1) and (CS = 1) and (LS = 1) Then SC
Bookmarks