找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1880|回復(fù): 0
收起左側(cè)

proteus學(xué)習(xí)單片機1-Blink

[復(fù)制鏈接]
ID:297403 發(fā)表于 2018-3-30 15:58 | 顯示全部樓層 |閱讀模式
電路圖

Proteus 52最小系統(tǒng)

Proteus 52最小系統(tǒng)

代碼:
  1. #include <reg52.h>

  2. #define uchar unsigned char
  3. #define uint unsigned int

  4. sbit LED=P1^0;

  5. //延時
  6. void DelayMS(uint x)
  7. {
  8.         uchar i;
  9.         while(x--)
  10.         {
  11.                 for(i=0;i<120;i++);
  12.         }
  13. }
  14. void main()
  15. {
  16.         while(1)
  17.         {
  18.                 LED=~LED;
  19.                 DelayMS(150);
  20.         }
  21. }
復(fù)制代碼



回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表