当前位置:网站首页>Esp8266 Arduino programming example - timer and interrupt
Esp8266 Arduino programming example - timer and interrupt
2022-07-28 21:58:00 【Vision & IOT intelligence】
Timer and interrupt
ESP8266 Timer0 and Timer1 There are two timers , Its WiFi The function uses a timer . We can only use a certain timer . To avoid crash problems , stay Arduino It is recommended to use... In the framework Ticker instead of Timer. Ticker Perform the same function as the timer .
This example will demonstrate how to use timer and interrupt to realize LED flashing .
The speed calculation formula of the timer is as follows :
Timer speed (Hz) = Timer clock speed (Mhz) / Preassigned frequency counter
Preassigned frequency counter / The frequency divider divides the above frequency to form a timer “ Tick tock (tick)”( Increase its counter ). And then ISR Configured to trigger after a certain number of ticks .
Prescaler is used , Because the timer can only be stored in its counter at most 8/16 position , This means that for 8 Bit counter , They will every 256/16000000 second (16us) overflow , about 16 Bit counter , They will every 65536 / 16000000 second (4us) overflow , This is usually far more than necessary . Prescaler allows it to be scaled to allow longer intervals .
1、 Hardware preparation
- ESP8266 NodeMCU Development board
- LED One
- 470 An ohmic resistor
- There are several DuPont lines
- A data line
2、 Software preparation
- Arduino IDE or VSCode + PlatformIO
In the previous article , How to build ESP8266 The development environment is introduced in detail , Please refer to :
边栏推荐
- Zhuzhou Jiufang middle school carried out drowning prevention and fire safety education and training activities
- Nano gold coupled antibody / protein Kit (20nm, 1mg/100 μ g/500 μ G coupling amount) preparation
- Assign a string pointer to an array [easy to understand]
- NTP server time (view server time)
- HCIA综合实验(以华为eNSP为例)
- 基于BRNN的政务APP评论端到端方面级情感分析方法
- Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 2)
- Data interpolation -- normalize data of different magnitude
- RHCSA第一天
- 节省70%的显存,训练速度提高2倍!浙大&阿里提出在线卷积重新参数化OREPA,代码已开源!(CVPR 2022 )
猜你喜欢

两个全局变量__dirname和__filename 、fs模块常用功能进一步介绍

LeetCode链表问题——面试题02.07.链表相交(一题一文学会链表)

kali里的powersploit、evasion、weevely等工具的杂项记录

Oracle, SQL Foundation

Gateway technology of IOT technology stack

Is it necessary to calibrate the fluke dtx-1800 test accuracy?

详解visual studio 2015在局域网中远程调试程序

使用Mock技术帮助提升测试效率的小tips,你知道几个?

数据插值——对不同量级的数据进行归一化

MySQL 是如何归档数据的呢?
随机推荐
OA项目之会议通知(查询&是否参会&反馈详情)
MSI Bao'an factory is on fire! Official response: no one was injured, and the production line will not be affected!
openEuler Embedded SIG | 分布式软总线
Standard C language learning summary 10
Assign a string pointer to an array [easy to understand]
不用Swagger,那我用啥?
90. 子集 II
搞事摸鱼一天有一天
如何高效、精准地进行图片搜索?看看轻量化视觉预训练模型
微信小程序开发公司你懂得选择吗?
Hold high the two flags of 5g and AI: Ziguang zhanrui Market Summit is popular in Shencheng
LT7911D Type-C/DP转mipi 方案成熟可提供技术支持
Log slimming operation: how to optimize from 5g to 1g! (glory Collection Edition)
With the help of domestic chip manufacturers, the shipment of white brand TWS headphones has reached 600million in 2020
基于对象的实时空间音频渲染丨Dev for Dev 专栏
Zhuzhou Jiufang middle school carried out drowning prevention and fire safety education and training activities
Research on weapon equipment attribute extraction based on attribute word completion
MATLAB从入门到精通 第1章 MATLAB入门
Coolpad voluntarily terminated the patent infringement lawsuit against Xiaomi
HCIA综合实验(以华为eNSP为例)