当前位置:网站首页>LED light of single chip microcomputer learning notes
LED light of single chip microcomputer learning notes
2022-07-07 13:13:00 【ly_ zszcyx】
Use the development board :
Puzhong science and technology development board
Compiling software :
keil
Briefly review the LED (led), The core of LED is made of P Type semiconducting body and N Type semiconductor Composed of wafer , stay P Type semiconductor and N There is a transition layer between type a semiconductors , be called PN junction . It has a single conductivity .
Positive and negative judgment :
Usually :
1、 Yes The gap One end of is negative ;
2、 The end with the horizontal bar is the negative pole ;
3、 One end with a white parallel bar is a negative pole ;
4、 One end in the direction of the triangular arrow is the negative pole ;
5、 One end of the small circle of plug-in diode silk screen printing is the negative pole , The big circle is the positive pole .
In vertical position welding In this case, the original body is in the positive ring
6、 The square hole of the plug-in LED is the first pin and the positive pole is the first pin .
Schematic diagram of development board :

Light a lamp , Set the corresponding discipline to low level
sbit Variable name = Address values ;
Code :
#include "reg52.h" // This file defines some special function registers of MCU
#include<intrins.h> // Because you're going to use the left-right shift function , So add this header file
sbit led0 = P2^0; // The of single chip microcomputer P2.0 The port is defined as led0
sbit led1 = P2^1;
sbit led2 = P2^2;
sbit led3 = P2^3;
sbit led4 = P2^4;
sbit led5 = P2^5;
sbit led6 = P2^6;
sbit led7 = P2^7;
// Lighten up 8 individual led The lamp
void lighterLed()
{
while(1)
{
led0=0; //P2.0 The port is set to low level
led1=0; //P2.1 The port is set to low level
led2=0; //P2.2 The port is set to low level
led3=0; //P2.3 The port is set to low level
led4=0; //P2.4 The port is set to low level
led5=0; //P2.5 The port is set to low level
led6=0; //P2.6 The port is set to low level
//led7=0; //P2.7 The port is set to low level
}
}
/*******************************************************************************
* Letter Count name : main
* The functionality : The main function
* transport Enter into : nothing
* transport Out : nothing
*******************************************************************************/
void main()
{
lighterLed(); // Lighten up LED
}边栏推荐
- PAcP learning note 3: pcap method description
- DrawerLayout禁止侧滑显示
- ClickHouse(03)ClickHouse怎么安装和部署
- MongoDB内部的存储原理
- 认养一头牛冲刺A股:拟募资18.5亿 徐晓波持股近40%
- 将数学公式在el-table里面展示出来
- “新红旗杯”桌面应用创意大赛2022
- 工具箱之 IKVM.NET 项目新进展
- 【学习笔记】线段树选做
- Japanese government and enterprise employees got drunk and lost 460000 information USB flash drives. They publicly apologized and disclosed password rules
猜你喜欢

Vscode编辑器ESP32头文件波浪线不跳转彻底解决

Sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]

About how appium closes apps (resolved)

- Oui. Migration entièrement automatisée de la Sous - base de données des tableaux d'effets sous net

Storage principle inside mongodb
![[learning notes] agc010](/img/2c/37f2537a4dadd84adacf3da5f1327a.png)
[learning notes] agc010

飞桨EasyDL实操范例:工业零件划痕自动识别
![[untitled]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled]

QQ的药,腾讯的票

【无标题】
随机推荐
Milkdown 控件图标
MySQL master-slave replication
regular expression
存储过程的介绍与基本使用
MongoDB 分片总结
认养一头牛冲刺A股:拟募资18.5亿 徐晓波持股近40%
关于 appium 启动 app 后闪退的问题 - (已解决)
MongoDB复制(副本集)总结
Enterprise custom form engine solution (XII) -- experience code directory structure
靠卖概念上市,认养一头牛能走多远?
人均瑞数系列,瑞数 4 代 JS 逆向分析
信号强度(RSSI)知识整理
Cinnamon Applet 入门
环境配置篇
JS判断一个对象是否为空
Summary of import, export, backup and recovery of mongodb
error LNK2019: 无法解析的外部符号
Realbasicvsr test pictures and videos
Sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
工具箱之 IKVM.NET 项目新进展