资源简介
flexitimer2库,arduino计时器中断库文件,适用于颜色识别模块的颜色识别过程中的计时器中断

代码片段和文件信息
/*
FlexiTimer2.h - Using timer2 with a configurable resolution
Wim Leers
based on MsTimer2
Javier Valencia
History:
16/Dec/2011 - Added Teensy/Teensy++ support (bperrybap)
note: teensy uses timer4 instead of timer2
25/April/10 - based on MsTimer2 V0.5 (from 29/May/09)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License or (at your option) any later version.
This library is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not write to the Free Software
Foundation Inc. 51 Franklin St Fifth Floor Boston MA 02110-1301 USA
*/
#include
unsigned long FlexiTimer2::time_units;
void (*FlexiTimer2::func)();
volatile unsigned long FlexiTimer2::count;
volatile char FlexiTimer2::overflowing;
volatile unsigned int FlexiTimer2::tcnt2;
void FlexiTimer2::set(unsigned long ms void (*f)()) {
FlexiTimer2::set(ms 0.001 f);
}
/**
* @param resolution
* 0.001 implies a 1 ms (1/1000s = 0.001s = 1ms) resolution. Therefore
* 0.0005 implies a 0.5 ms (1/2000s) resolution. And so on.
*/
void FlexiTimer2::set(unsigned long units double resolution void (*f)()) {
float prescaler = 0.0;
if (units == 0)
time_units = 1;
else
time_units = units;
func = f;
#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega48__) || defined (__AVR_ATmega88__) || defined (__AVR_ATmega328P__) || defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
TIMSK2 &= ~(1< TCCR2A &= ~((1< TCCR2B &= ~(1< ASSR &= ~(1< TIMSK2 &= ~(1<
if ((F_CPU >= 1000000UL) && (F_CPU <= 16000000UL)) { // prescaler set to 64
TCCR2B |= (1< TCCR2B &= ~((1< prescaler = 64.0;
} else if (F_CPU < 1000000UL) { // prescaler set to 8
TCCR2B |= (1< TCCR2B &= ~((1< prescaler = 8.0;
} else { // F_CPU > 16Mhz prescaler set to 128
TCCR2B |= ((1< TCCR2B &= ~(1< prescaler = 128.0;
}
#elif defined (__AVR_ATmega8__)
TIMSK &= ~(1< TCCR2 &= ~((1< TIMSK &= ~(1< ASSR &= ~(1<
if ((F_CPU >= 1000000UL) && (F_CPU <= 16000000UL)) { // prescaler set to 64
TCCR2 |= (1< TCCR2 &= ~((1< prescaler = 64.0;
} else if (F_CPU < 1000000UL) { // prescaler set to 8
TCCR2 |= (1< TCCR2 &= ~((1< prescaler = 8.0;
} else { // F_CPU > 16Mhz p
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1205 2012-02-14 01:16 flexitimer2库\wimleers-flexitimer2-7338cfb\examples\FlashLed\FlashLed.pde
文件 6515 2012-02-14 01:16 flexitimer2库\wimleers-flexitimer2-7338cfb\FlexiTimer2.cpp
文件 518 2012-02-14 01:16 flexitimer2库\wimleers-flexitimer2-7338cfb\FlexiTimer2.h
文件 63 2012-02-14 01:16 flexitimer2库\wimleers-flexitimer2-7338cfb\keywords.txt
目录 0 2018-12-21 16:25 flexitimer2库\wimleers-flexitimer2-7338cfb\examples\FlashLed
目录 0 2018-12-21 16:25 flexitimer2库\wimleers-flexitimer2-7338cfb\examples
目录 0 2018-12-21 16:25 flexitimer2库\wimleers-flexitimer2-7338cfb
目录 0 2018-12-21 16:25 flexitimer2库
----------- --------- ---------- ----- ----
8301 8
相关资源
- ADNS-3080光流传感器测试程序Arduino
- EESkill NRF24L01 无线模块用户手册
- Arduino nano 工程文件
- Arduino教程 Lesson 之--自制风扇
- 基于Arduino的智能环境监控系统设计
- 基于Arduino和Machtalk的温棚环境监测系
- 开源图像库leptonica头文件和库文件
- arduino pca9685多舵机同时控制案例
- QT生成DLL库文件的方法和使用方法详解
- DOS下的TCP-IP协议库文件原代码.rar
- dll文件全集(473个).rar
- arduino技术内幕
- 最新整理 盘古分词 dct词库文件 7205
- Arduino电子设计实战指南.零基础篇_超
- 物联网智能家居平台DIY:ARDUINO 物联网
- 实验1.zip arduino跑马灯led灯实验,串口
- opencat所有资料.zip
- STC库文件 STC.CDB
- arduino主机,stm8从机。I2C测试 。每次
- DS18B20_Serial_println.ino
- ps2手柄arduino库文件
- hidapi进行USB通讯必备的库文件和头文
- 基于手机蓝牙的arduino遥控小车
- DHT11 21 22库文件
- arduino中的can库函数
- PrintShare破解版+打印机驱动、PDF库文件
- 密码+指纹锁资料包.rar
- 贝壳物联arduino esp8266 demo版本
- HMC5883L罗盘指南针模块库文件及中英文
- arduino 小贱钟源码及教程
评论
共有 条评论