thank
Melanie
i cant understand..
-this is a programming for DC MOTOR CONTROLLER (my final project)
-i've run and test the programming but still have a problem at the circuit
-i think the circuit is ok, but the programming for sensor is not ok!
-below are my program
'PIC BASIC PRO FOR DC MOTOR CONTROLLER
'PIC16F84A
TRISA = %00000000
TRISB = %00000111
loop:
High PORTA.0 'this is to transmit the signal from sensor
Low PORTA.1
IF (PORTB.0=1) AND (PORTB.1=1) AND (PORTB.2=1) Then
GoSub motorfast
EndIF
IF (PORTB.0=1) AND (PORTB.1=1) AND (PORTB.2=0) Then
GoSub motormedium
EndIF
IF (PORTB.0=1) AND (PORTB.1=0) AND (PORTB.2=0) Then
GoSub motorslow
EndIF
IF (PORTB.0=1) AND (PORTB.1=1) AND (PORTB.2=1) Then
GoSub motorstop
EndIF
GoTo loop
motorfast:
High PORTB.7
LCDOut $FE, 1,"No Object Found"
LCDOut $FE, $C0,"MOTOR FAST"
Return
motormedium:
LCDOut $FE, 1,"Object Detect I"
LCDOut $FE, $C0,"MEDIUM SPEED"
High PORTB.7
Pause 2
Low PORTB.7
Pause 2
Return
motorslow:
LCDOut $FE, 1,"Object Detect II"
LCDOut $FE, $C0,"SLOW SPEED"
High PORTB.7
Pause 4
Low PORTB.7
Pause 4
Return
motorstop:
LCDOut $FE, 1," WARNING! "
LCDOut $FE, $C0,"SLOW SPEED"
Low PORTB.7
Return
-the problem is the ultrasonic sensor didn't function after the circuit is ON
-maybe it is cause by the programming and i'm not sure how to settle it
-i think the problem is at ultrasonic trasmitter programming
-can anybody help me to solve this...?
i put my circuit in attached file
Bookmarks