Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PicBasic Pro (Something wrong)

Status
Not open for further replies.

yuchween

New Member
I wondered what happened to my program
anyone here knows on PicBasicPro compiler?
I used PicBasic Pro to Program my PIC, but at first my vehicle works fine with that program, but later on, the PIC just couldnt work at all.

this is the program

cl var byte
trisb = 224 'port5,port6,port7 input


start:

Low portb
cl = portb

'cl.5 is from left sensor
'cl.6 is from center sensor
'cl.7 is from right sensor
if cl.5 = 1 and cl.7 = 0 and cl.6=1 then left

if cl.5 = 1 and cl.7 = 0 and cl.6=0 then left

if cl.6 = 1 and cl.5 = 0 and cl.7=0 then straight

if cl.5 = 0 and cl.7 = 1 and cl.6=0 then right

if cl.5 = 0 and cl.7 = 1 and cl.6=1 then right

if cl.5 = 0 and cl.6 = 0 and cl.7=0 then stationary


'portb.4 is controlling left motor
'portb.3 is controlling right motor
stationary:
low portb.4
low portb.3
low portb.2
goto start

left:
Low PORTB.4
High PORTB.3
pause 500
high PORTB.2
pause 100
low PORTB.2
goto start

right:
High PORTB.4
LOw PORTB.3
pause 500
high PORTB.2
pause 100
low PORTB.2
goto start

straight:
LOw PORTB.3
LOw PORTB.4
high PORTB.2
goto start



this program was working at first, but now i doesnt know what happened to the PIC even i had changed with a new PIC

Murphy law just happens any time. I project presentation is drawing closer and a lot of things do not seem right.
The PIC cant give output signals.
 
Is the PIC getting any power & is the oscillator working would be a starting point.
 
Get a scope and check power and OSC like Paul said, or drop an LED and resistor on an output pin and add code to pulse it to make sure it is running.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top