các bạn xem thử nhé
mình mới tìm thấy bài luận văn này hay lắm
Collapse
X
-
Bạn có thể gửi sơ đồ lên được kô. Mà phối hợp trở kháng như thế nào cho tốt mình nghĩ bạn đã tốt khi gửi tài liệu lên thì nên nói rõ luôn.Nguyên văn bởi 111985 View Postbộ chuyển đổi 232-485 bạn có thể tìm ở bất cứ ở đâu trên mạng. Chú ý khi lặp mạch này bạn phải phối hợp trở kháng cho tốt nếu không thì số thiết bị kết nối không cao. Nếu bạn cần có thể mình sẽ gửi cho bạn sơ đồ này.
Cám ơn
Cheers!
hoanf
-
em muốn tim đồ án đèn giao thông
các bác đã làm đồ án roi ơi?em đang làm đồ án mạch đèn giao thông,mà không có tài liệu,các bác có lai liệu thì giúp em với,thành thật cảm ơn các bác nhá
Comment
-
mình mới viết được chương trình dùng VDk Pic6f877a. Ở đây mình sử dụng bàn phím để chọn các kiểu sáng của đèn led đơn. Nhằm cho các bạn dễ hiểu. Bài sau mình sẽ post hẳn bài về giao tiếp bàn phím với LCD. Port d bàn phím, Port b điều khiển led.
#include <16F877A.h>
#device *16adc=8
#fuses xt,nowdt,nolvp,noprotect
#use delay(clock=4000000)
#use fast_io(b)
void main()
{
output_b(0b11111111);
set_tris_b(0);
output_d(0b11111111);
delay_ms(10);
while(true)
{
output_d(0b11111110);
delay_ms(10);
if(input(pin_d4)==0)//nhấn phim1
{
while(true)
{ ////////////// kieu1
output_b(0x7f);
delay_ms(150);
output_b(0xBf);
delay_ms(150);
output_b(0xef);
delay_ms(150);
output_b(0xf7);
delay_ms(150);
output_b(0xfb);
delay_ms(150);
output_b(0xfd);
delay_ms(150);
output_b(0xfe);
delay_ms(150);
//////////////
output_b(0xfe);
delay_ms(150);
output_b(0xfd);
delay_ms(150);
output_b(0xfb);
delay_ms(150);
output_b(0xf7);
delay_ms(150);
output_b(0xef);
delay_ms(150);
output_b(0xbf);
delay_ms(150);
output_b(0x7f);
delay_ms(150);
if(input(pin_d5)==0||input(pin_d6)==0||input(pin_d 7)==0)
break;
}
}
if(input(pin_d5)==0)//nhấn phím 2
{
while(true)
{ /////////// kieu 2
output_b(0x00);
delay_ms(150);
output_b(0xff);
delay_ms(150);
if(input(pin_d4)==0||input(pin_d6)==0||input(pin_d 7)==0)
break;
}
}
if(input(pin_d6)==0)//nhấn phím 3
{
while(true)
{ //////////////kieu 3
output_b(0x55);
delay_ms(150);
output_b(0xaa);
delay_ms(150);
if(input(pin_d4)==0||input(pin_d5)==0||input(pin_d 7)==0)
break;
}
}
if(input(pin_d7)==0)//nhấn phím 4
{
while(true)
{ /////////////kieu 4
output_b(0x7e);
delay_ms(150);
output_b(0xbd);
delay_ms(150);
output_b(0xdb);
delay_ms(150);
output_b(0xE7);
delay_ms(150);
output_b(0xdb);
delay_ms(150);
output_b(0xbd);
delay_ms(150);
output_b(0x7e);
delay_ms(150);
if(input(pin_d6)==0||input(pin_d4)==0||input(pin_d 5)==0)
break;
}
}
}
}
Bạn nào có thắc mắc liên hệ mình theo địa chỉ này nha:
ngochai_dt06b@yahoo.com.vn
chuc các bạn thành công với VDK PIC nha.
Comment
-
hic , mới quét có 4 phím mà code dài 1 đống , quét ma trận chắc chết mất !Nguyên văn bởi hai dang View Postmình mới viết được chương trình dùng VDk Pic6f877a. Ở đây mình sử dụng bàn phím để chọn các kiểu sáng của đèn led đơn. Nhằm cho các bạn dễ hiểu. Bài sau mình sẽ post hẳn bài về giao tiếp bàn phím với LCD. Port d bàn phím, Port b điều khiển led.
#include <16F877A.h>
#device *16adc=8
#fuses xt,nowdt,nolvp,noprotect
#use delay(clock=4000000)
#use fast_io(b)
void main()
{
output_b(0b11111111);
set_tris_b(0);
output_d(0b11111111);
delay_ms(10);
while(true)
{
output_d(0b11111110);
delay_ms(10);
if(input(pin_d4)==0)//nhấn phim1
{
while(true)
{ ////////////// kieu1
output_b(0x7f);
delay_ms(150);
output_b(0xBf);
delay_ms(150);
output_b(0xef);
delay_ms(150);
output_b(0xf7);
delay_ms(150);
output_b(0xfb);
delay_ms(150);
output_b(0xfd);
delay_ms(150);
output_b(0xfe);
delay_ms(150);
//////////////
output_b(0xfe);
delay_ms(150);
output_b(0xfd);
delay_ms(150);
output_b(0xfb);
delay_ms(150);
output_b(0xf7);
delay_ms(150);
output_b(0xef);
delay_ms(150);
output_b(0xbf);
delay_ms(150);
output_b(0x7f);
delay_ms(150);
if(input(pin_d5)==0||input(pin_d6)==0||input(pin_d 7)==0)
break;
}
}
if(input(pin_d5)==0)//nhấn phím 2
{
while(true)
{ /////////// kieu 2
output_b(0x00);
delay_ms(150);
output_b(0xff);
delay_ms(150);
if(input(pin_d4)==0||input(pin_d6)==0||input(pin_d 7)==0)
break;
}
}
if(input(pin_d6)==0)//nhấn phím 3
{
while(true)
{ //////////////kieu 3
output_b(0x55);
delay_ms(150);
output_b(0xaa);
delay_ms(150);
if(input(pin_d4)==0||input(pin_d5)==0||input(pin_d 7)==0)
break;
}
}
if(input(pin_d7)==0)//nhấn phím 4
{
while(true)
{ /////////////kieu 4
output_b(0x7e);
delay_ms(150);
output_b(0xbd);
delay_ms(150);
output_b(0xdb);
delay_ms(150);
output_b(0xE7);
delay_ms(150);
output_b(0xdb);
delay_ms(150);
output_b(0xbd);
delay_ms(150);
output_b(0x7e);
delay_ms(150);
if(input(pin_d6)==0||input(pin_d4)==0||input(pin_d 5)==0)
break;
}
}
}
}
Bạn nào có thắc mắc liên hệ mình theo địa chỉ này nha:
ngochai_dt06b@yahoo.com.vn
chuc các bạn thành công với VDK PIC nha.
Comment
Comment