(2-1)点亮一个LED
(2-1)点亮一个LED一个单片机是MCU,那么单片机里面就有一个CPU(代码都是在这里面执行的),我们外部都是有引脚都是P2口的引脚。那么CPU是怎么样控制引脚的呢?简单来说就是CPU通过配置这些控制的寄存器来控制我们的硬件电路,硬件电路来执行我们想要去完成的功能
根据led工作原理,电源的正极应当接到led的阳极,同时阴极须与“负极”连接到一起,即让单片机的P20口为低电平。
样例112345#include <REGX52.H>void main(){ P2 = 0xFE;}
样例1与样例2作用相同
样例21234567#include <REGX
数据结构实验之栈与队列一:进制转换
Description对于一个基于二元运算符的算术表达式,转换为对应的后缀式,并输出之。
Input输入一个算术表达式,以‘#’字符作为结束标志。
Output输出该表达式转换所得到的后缀式。
程序123456789101112131415161718192021222324252627282930#include<bits/stdc++.h>using namespace std;typedef struct Node{ int Data[1005]; int t;} mystack;void change(int num, int R){ if(n
数据结构实验之栈与队列一:进制转换
第一道数据结构题目,照搬CSDN文章上的标准解法,想通过“临摹”的方法对数据结构入门和栈与队列有一个初步的认识,故作批注。
正文部分程序123456789101112131415161718192021222324252627282930#include<bits/stdc++.h>using namespace std;typedef struct Node{ int Data[1005]; int t;} mystack;void change(int num, int R){ if(num == 0){ cout << 0
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo ser