![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
51单片机
学习记录
Ho_Yim
Pointers are everything.
展开
-
蓝桥杯超声波
//蓝桥杯超声波模块#include "STC15F2K60S2.h" #include "intrins.h"sbit beep = P0^6;sbit a = P2^5;sbit b = P2^6;sbit c = P2^7;sbit trig = P1^0;sbit echo = P1^1;#define Y7C {a = b = c = 1;} //dula#define Y6C {a = 0;b = c = 1;} //wela原创 2022-02-25 12:36:20 · 709 阅读 · 0 评论 -
51外部中断学习记录
#include "reg52.h"void delay_ms(int x){ int i; for(;x>0;--x) for(i=110;i>0;--i);}main(){ EA = 1; EX0 = 1; EX1 = 1; IT0 = 0; //INT0:电平触发 IT1 = 1; //INT1:跳变沿触发 P2 = 0X55; while(1);}void Ex_INT0(void) interrupt 0 //外部中断服务函数原创 2021-11-24 14:46:33 · 74 阅读 · 0 评论 -
C51蓝牙小车制作及代码
C51蓝牙小车1.材料:4WD板子,L298N电机驱动模块,稳压模块,C51(2)芯片,芯片底座,HC-05蓝牙模块,杜邦线,三节3.7V充电电池,一个DC电池盒。注意:4WD底板有4个130马达,所以L298N需要两个,单片机供电为5V,蓝牙模块供电为3.6到6V之间,故用稳压模块是为蓝牙模块和C51芯片供电。130马达可以承受11V左右的电压但建议用PWM降压让它维持在8V左右的电压。2.关于接线:我圈起来的就是重点了,首先一个L298N直接将11V电压接入(先了解下L298N原创 2020-07-10 16:04:56 · 5873 阅读 · 9 评论 -
基于51的HC_SR04学习记录
#include "reg52.h"#include "intrins.h"#include "stdio.h"/********************************************************************超声波工作原理: Trig脚先发出持续10us的高电平,然后echo接收到一定比例的声波,这期间echo为高电平,声波消失echo电平再次变为低电平***************************************************原创 2021-11-18 13:20:45 · 282 阅读 · 0 评论 -
基于51的DS18B20驱动
#include "reg52.h"#include "stdio.h"#include "intrins.h"#define uchar unsigned char //1字节,8位#define uint unsigned int //2字节,16位sbit ds = P3^7; //DS18B20输出口/*************************************************************原创 2021-11-19 22:34:50 · 833 阅读 · 0 评论 -
51串口的学习记录
51串口的学习记录#include "reg52.h"#include "stdio.h"#include "intrins.h"/********************************Fm = Fosc/12 ===>>> Tm = 12Tosc********************************/char dat = 65;int num=0;void delayms(int x){ int t; for(;x>0;--x) f原创 2021-11-15 12:32:27 · 535 阅读 · 0 评论