專注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

三種型號(hào)單片機(jī)點(diǎn)亮一只發(fā)光二極管程序

作者:佚名   來(lái)源:本站原創(chuàng)   點(diǎn)擊數(shù):  更新時(shí)間:2012年09月16日   【字體:

/***************STC89C52RC*************/
#include<reg52.h>
sbit LED=P1^0;
void main()
{
   LED=0;
   while(1);
}

/*******ATMEGA16A****************/
#include <iom16v.h>
#include <macros.h>
void main()
{
  DDRA=0X01;
  PORTA&=BIT(PORTA7);
  while(1);
}

/*******PIC16F877**********************/
#include<pic.h>
#define uint unsigned int
#define uchar unsigned char
__CONFIG(0X3B31);
void main()
{
  TRISA0=0;
  RA0=0;
  while(1);
}
 

關(guān)閉窗口

相關(guān)文章