專注差異化嵌入式產(chǎn)品解決方案 給智能產(chǎn)品定制注入靈魂給予生命
提供開發(fā)工具、應(yīng)用測試 完善的開發(fā)代碼案例庫分享
從全面的產(chǎn)品導(dǎo)入到強(qiáng)大技術(shù)支援服務(wù) 全程貼心伴隨服務(wù),創(chuàng)造無限潛能!
提供新的芯片及解決方案,提升客戶產(chǎn)品競爭力
提供最新的單片機(jī)資訊,行業(yè)消息以及公司新聞動(dòng)態(tài)
CCSC LED2.c程序功能和MCD2demo LED2.asm相似
///////////////////////////////////////////////////////////////////////////////
// MPLAB IDE V7.11 + CCS C3.18
// LED2 for MCD2-demo
//
// by LW7807@163.com
// 2005/06/16
///////////////////////////////////////////////////////////////////////////////
#include "16F877A.h" // PIC16F877 header file
#use delay(clock=4000000) // for 4Mhz crystal
#fuses XT, NOWDT, NOPROTECT, NOLVP // for debug mode
void main(void)
{
int8 tmp = 0; // tmp var
set_tris_b(0xff); // set PORTB for intput
set_tris_c(0x00); // set PORTC for output
output_c(tmp); // PORTC output 0
while(1){
while(1 == (input_b()&0x01)) // wait put button
{
delay_ms(10);
}
output_c(++ tmp); // output number
while(0 == (input_b() & 0x01)) // wait free button
{
delay_ms(10);
}
}//end while(1)
}//end main()