当前位置:网站首页>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 :
边栏推荐
- Cy3/cy5/cy5.5/cy7 fluorescent labeling antibody / protein Kit (10~100mg labeling amount)
- 中国农业工程学会农业水土工程专业委员会-第十二届-笔记
- Open earphone which air conduction earphone with good sound quality and recognized sound quality is recommended
- HCIA综合实验(以华为eNSP为例)
- fluke dtx-1800测试精度有必要进行原厂校准吗?
- Getting started with Oracle
- Adventures of little mouse: behind the scenes gags of moss 2
- HCIA comprehensive experiment (take Huawei ENSP as an example)
- Skiasharp's WPF self drawn drag ball (case version)
- kubevela插件addons下载地址
猜你喜欢

基于复杂网络的大群体应急决策专家意见与信任信息融合方法及应用

The University was abandoned for three years, the senior taught himself for seven months, and found a 12K job

管理区解耦架构见过吗?能帮客户搞定大难题的

基于对象的实时空间音频渲染丨Dev for Dev 专栏

Information fusion method and application of expert opinion and trust in large group emergency decision-making based on complex network

Practice and exploration of overseas site Seata of ant group

小程序开发需要什么技术

Getting started with Oracle

大学荒废三年,大四自学7个月测试,找到了12K的工作

Chinese patent keyword extraction based on LSTM and logistic regression
随机推荐
[Bluetooth Bluetooth development] VIII. Transmission layer of ble protocol
Data interpolation -- normalize data of different magnitude
物联网技术栈之网关技术
基于复杂网络的大群体应急决策专家意见与信任信息融合方法及应用
kubevela插件addons下载地址
基于知识元的外文专利文献知识描述框架
LeetCode·581.最短无序连续子数组·双指针
NTP server time (view server time)
fluke dtx-1800测试精度有必要进行原厂校准吗?
Research on weapon equipment attribute extraction based on attribute word completion
Professional Committee of agricultural water and soil engineering of China Association of Agricultural Engineering - 12th session - Notes
基于属性词补全的武器装备属性抽取研究
Matlab|基础知识总结一
Research on intangible cultural heritage image classification based on multimodal fusion
No swagger, what do I use?
Leetcode 142. circular linked list II [knowledge points: speed pointer, hash table]
PyQt5快速开发与实战 5.4 网页交互
标准C语言学习总结10
Layout the 6G track in advance! Ziguang zhanrui released the white paper "6G unbounded AI"
Leetcode linked list question - interview question 02.07. linked list intersection (learn linked list by one question and one article)