▼ กำลังโหลดข้อมูล... ▼
แสดงความคิดเห็น
คุณสามารถแสดงความคิดเห็นกับกระทู้นี้ได้ด้วยการเข้าสู่ระบบ
กระทู้ที่คุณอาจสนใจ
อ่านกระทู้อื่นที่พูดคุยเกี่ยวกับ
วิศวกรรมศาสตร์
วิศวกรรมคอมพิวเตอร์
Microcontroller
Microprogramming
ขอคำแนำนำเรื่องโค็ตควบคุม MCU PIC หน่อยคับ
หลอดไฟ8ตัวต่อเข้ากับพอตd
สวิตตัวกดติดปล่อยดับต่อเข้าพอตc
สวิตตัวกดไฟวิ่งปล่อยดับต่อเข้าพอตb
โค็ดไฟกดเปิดปล่อยดับที่ผมใช้
Void main (void)
{
While(1)
{
While(Portc=0x00);
portd=0xff;
While(portc=0xff);
Portd=0x00;
}
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
โค็ดไฟวิ่ง
Void Delays10KTCYx (unsigned char unit)
While(1)
{
While(portb=0x00)
{
Delay10KTCYx(50);
Portd=0x01;
Delay10KTCYx(50);
Portd=0x02;
Delay10KTCYx(50);
Portd=0x04;
Delay10KTCYx(50);
Portd=0x08;
Delay10KTCYx(50);
Portd=0x10;
Delay10KTCYx(50);
Portd=0x20;
Delay10KTCYx(50);
Portd=0x40;
Delay10KTCYx(50);
Portd=0x80;
}
While(portd=0xff);
{
Delay10KTCYx(50);
Portd=0x00;
Delay10KTCYx(50);
Portd=0x00;
Delay10KTCYx(50);
Portd=0x00;
Delay10KTCYx(50);
Portd=0x00;
Delay10KTCYx(50);
Portd=0x00;
Delay10KTCYx(50);
Portd=0x00;
Delay10KTCYx(50);
Portd=0x000;
Delay10KTCYx(50);
Portd=0x000;
}
}
}