?? p1口的應用(一).c
字號:
/*************************************************************************************
P1口的應用(一)
****************************************************************************************/
#include"reg51.h"
#define uint unsigned int
#define uchar unsigned char
sbit DIPswitch=P1^2;
sbit blueLED=P1^0;
sbit greenLED=P1^1;
void main(void)
{
P1=0XFF;
while(1)
if (DIPswitch==1)
{blueLED=0;greenLED=1;}
else
{greenLED=0;blueLED=1;}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -