|
查看: 1530|回复: 3
|
可以帮我看下这 code 有问题吗?
[复制链接]
|
|
|
为什么我的LCD display 有时有字,有时没(乱码)。我的code有问题吗?请各位高手帮我看下。谢谢#use delay (clock=20000000) // 20MHz
#include <lcd.c>
#FUSES HS,NOWDT, NOPROTECT, BROWNOUT, NOLVP, PUT
#use rs232 (baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERROR) //serial
#define SERVO1 PIN_c1
#define led_green PIN_d1
#define led_red PIN_d0
int8 i; // looping
void nocar()
{
for (i=0;i<30;i++) //0 deg
{
output_low(led_green);
output_high(led_red);
output_high(SERVO1);
delay_us(1500);
output_low(SERVO1);
delay_ms(18);
}
delay_ms(200);
lcd_init();
lcd_putc("\fDoor Closed");
lcd_putc("\nScan Your Card");
}
void car()
{
for (i=0;i<30;i++) // 90 deg
{
output_low(led_red);
output_high(led_green);
output_high(SERVO1);
delay_us(2000);
output_low(SERVO1);
delay_ms(18);
}
delay_ms(200);
lcd_init();
lcd_putc("\fDoor Opened");
lcd_putc("\nYou Can Go Now");
}
void main()
{
while(1)
{
if(input(PIN_C0)) //Sensor input
{ nocar(); }
else
{ car(); }
}
} |
|
|
|
|
|
|
|
|
|
|
发表于 5-11-2011 11:15 PM
|
显示全部楼层
本帖最后由 wkloh 于 6-11-2011 12:28 PM 编辑
同学,请按版规发帖!
版规
重新更新版规地址了! |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 6-11-2011 11:38 AM
|
显示全部楼层
Not Found
The requested URL /viewt was not found on this server.
Apache/2.2.3 (CentOS) Server at cforum1.cari.com.my Port 80 |
|
|
|
|
|
|
|
|
|
|
发表于 6-11-2011 12:52 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|