Youssef_18
Newbie level 2
- Joined
- Apr 24, 2012
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Tunisia /mounastir
- Activity points
- 1,305
hello ALL ,
I build line follower robot -based pic16F877A and ULN2003A when i made the program it is work with isiss, but when i put it in the pic 1 motor rotates and the other 1 no pls check it fot me , i write it with micro pascal , pls help me .
This is the program :
pls help me and i wanna the lcd display when the robot turns right ,display right and when turns left , display left .
I build line follower robot -based pic16F877A and ULN2003A when i made the program it is work with isiss, but when i put it in the pic 1 motor rotates and the other 1 no pls check it fot me , i write it with micro pascal , pls help me .
This is the program :
Code Pascal - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 program Robotsuiveurdeligne; var x,y : LONGINT; v :longint; txt: string[10]; begin TRISC:=0; PORTC:=0; USART_init(9600); lcd_config(portb,0,1,2,3,portb,6,5,4); lcd_cmd(LCD_CURSOR_OFF); lcd_out(1,1,' ROBOT SUIVEUR '); lcd_out(2,1,' DE LIGNE M_Y '); begin if Usart_Data_Ready = 1 then begin USART_write(Usart_Read); end; end; adcon1:=$80; // activation du convertisseur //pwm_init(1500); // activation du MLI //pwm_change_duty(180); // changement du rapport cyclique //pwm_start; while (true) do begin x:=adc_read(0); y:=adc_read(1); if (x > (y+40)) then begin PORTC.0:=1; PORTC.1:=0; PORTC.2:=1; PORTC.4:=0; end else if (y > (x+40)) then begin PORTC.0:=0; PORTC.1:=1; PORTC.2:=0; PORTC.4:=1; end else begin PORTC.0:=1; PORTC.1:=0; PORTC.2:=0; PORTC.4:=1; end; end; end.
pls help me and i wanna the lcd display when the robot turns right ,display right and when turns left , display left .
Attachments
Last edited by a moderator: