專注電子技術學習與研究
當前位置:單片機教程網 >> MCU設計實例 >> 瀏覽文章

三種型號單片機點亮一只發(fā)光二極管程序

作者:佚名   來源:本站原創(chuàng)   點擊數(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);
}
 

關閉窗口

相關文章