资源简介
这是配套的arduino温湿度传感器头文件以及oled显示头文件,在使用时需要将这些文件放在arduino库文件夹内,将博客程序复制新建.ino文件中即可使用。

代码片段和文件信息
/*
* Interrupt and PWM utilities for 16 bit Timer1 on ATmega168/328
* Original code by Jesse Tane for http://labs.ideo.com August 2008
* Modified March 2009 by Jérôme Despatis and Jesse Tane for ATmega328 support
* Modified June 2009 by Michael Polli and Jesse Tane to fix a bug in setPeriod() which caused the timer to stop
* Modified June 2011 by Lex Talionis to add a function to read the timer
* Modified Oct 2011 by Andrew Richards to avoid certain problems:
* - Add (long) assignments and casts to TimerOne::read() to ensure calculations involving tmp ICR1 and TCNT1 aren‘t truncated
* - Ensure 16 bit registers accesses are atomic - run with interrupts disabled when accessing
* - Remove global enable of interrupts (sei())- could be running within an interrupt routine)
* - Disable interrupts whilst TCTN1 == 0. Datasheet vague on this but experiment shows that overflow interrupt
* flag gets set whilst TCNT1 == 0 resulting in a phantom interrupt. Could just set to 1 but gets inaccurate
* at very short durations
* - startBottom() added to start counter at 0 and handle all interrupt enabling.
* - start() amended to enable interrupts
* - restart() amended to point at startBottom()
* Modiied 7:26 PM Sunday October 09 2011 by Lex Talionis
* - renamed start() to resume() to reflect it‘s actual role
* - renamed startBottom() to start(). This breaks some old code that expects start to continue counting where it left off
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation either version 3 of the License or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not see .
*
* See Google Code project http://code.google.com/p/arduino-timerone/ for latest
*/
#ifndef TIMERONE_cpp
#define TIMERONE_cpp
#include “TimerOne.h“
TimerOne Timer1; // preinstatiate
ISR(TIMER1_OVF_vect) // interrupt service routine that wraps a user defined function supplied by attachInterrupt
{
Timer1.isrCallback();
}
void TimerOne::initialize(long microseconds)
{
TCCR1A = 0; // clear control register A
TCCR1B = _BV(WGM13); // set mode 8: phase and frequency correct pwm stop the timer
setPeriod(microseconds);
}
void TimerOne::setPeriod(long microseconds) // AR modified for atomic access
{
long cycles = (F_CPU / 2000000) * microseconds; // the counter runs backwards after TOP interrupt is at BOTTOM so divide microseconds by 2
if(cycles < RESOLUTION)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 674 2018-10-10 17:40 arduino温湿度采集头文件\oled显示\examples\ISRbl
文件 216 2018-10-10 17:40 arduino温湿度采集头文件\oled显示\examples\ReadReciver\.svn\all-wcprops
文件 33 2018-10-10 17:40 arduino温湿度采集头文件\oled显示\examples\ReadReciver\.svn\dir-prop-ba
文件 436 2018-10-10 17:40 arduino温湿度采集头文件\oled显示\examples\ReadReciver\.svn\entries
文件 3527 2018-10-10 17:40 arduino温湿度采集头文件\oled显示\examples\ReadReciver\.svn\text-ba
文件 3527 2018-10-10 17:40 arduino温湿度采集头文件\oled显示\examples\ReadReciver\ReadReciver.pde
文件 995 2018-10-10 17:39 arduino温湿度采集头文件\oled显示\keywords.txt
文件 8023 2018-10-10 17:39 arduino温湿度采集头文件\oled显示\TimerOne.cpp
文件 3011 2018-10-10 17:39 arduino温湿度采集头文件\oled显示\TimerOne.h
文件 3806 2018-10-10 17:39 arduino温湿度采集头文件\温度传感器\Ds18b20\change.txt
文件 6450 2018-10-10 17:39 arduino温湿度采集头文件\温度传感器\Ds18b20\DallasTemperature(1).h
文件 20372 2018-10-10 17:39 arduino温湿度采集头文件\温度传感器\Ds18b20\DallasTemperature.cpp
文件 1351 2018-10-10 17:39 arduino温湿度采集头文件\温度传感器\Ds18b20\keywords.txt
文件 1916 2018-10-10 17:39 arduino温湿度采集头文件\温度传感器\Ds18b20\README.TXT
文件 3031 2018-10-10 17:40 arduino温湿度采集头文件\温度传感器\OneWire\examples\DS18x20_Temperature\DS18x20_Temperature (3).pde
文件 3031 2018-10-10 17:40 arduino温湿度采集头文件\温度传感器\OneWire\examples\DS18x20_Temperature\DS18x20_Temperature.pde
文件 1907 2018-10-10 17:40 arduino温湿度采集头文件\温度传感器\OneWire\examples\DS2408_Switch\DS2408_Switch.pde
文件 4098 2018-10-10 17:40 arduino温湿度采集头文件\温度传感器\OneWire\examples\DS250x_PROM\DS250x_PROM.pde
文件 1393 2018-10-10 17:40 arduino温湿度采集头文件\温度传感器\OneWire\examples\MAX31850_sample\MAX31850_sample.ino
文件 3543 2018-10-10 17:40 arduino温湿度采集头文件\温度传感器\OneWire\examples\MAX31850_Temperature\MAX31850_Temperature.ino
文件 1391 2018-10-10 17:40 arduino温湿度采集头文件\温度传感器\OneWire\examples\sample\sample.pde
文件 819 2018-10-10 17:39 arduino温湿度采集头文件\温度传感器\OneWire\keywords.txt
文件 17602 2018-10-10 17:39 arduino温湿度采集头文件\温度传感器\OneWire\OneWire.cpp
文件 8963 2018-10-10 17:39 arduino温湿度采集头文件\温度传感器\OneWire\OneWire.h
文件 1275 2018-10-10 17:39 arduino温湿度采集头文件\温度传感器\OneWire\readme.txt
文件 4193 2018-10-10 17:39 arduino温湿度采集头文件\湿度传感器\dht.cpp
文件 796 2018-10-10 17:39 arduino温湿度采集头文件\湿度传感器\dht.h
文件 2217 2018-10-10 17:40 arduino温湿度采集头文件\湿度传感器\examples\dht_test\dht_test.ino
目录 0 2019-10-25 18:39 arduino温湿度采集头文件\oled显示\examples\ReadReciver\.svn\text-ba
目录 0 2019-10-25 18:39 arduino温湿度采集头文件\oled显示\examples\ReadReciver\.svn
............此处省略21个文件信息
- 上一篇:GAOT工具箱
- 下一篇:VNC-viewer客户端 for win32,绿色版
相关资源
- ADNS-3080光流传感器测试程序Arduino
- EESkill NRF24L01 无线模块用户手册
- Arduino nano 工程文件
- Arduino教程 Lesson 之--自制风扇
- 基于Arduino的智能环境监控系统设计
- 基于Arduino和Machtalk的温棚环境监测系
- arduino pca9685多舵机同时控制案例
- arduino技术内幕
- Arduino电子设计实战指南.零基础篇_超
- 物联网智能家居平台DIY:ARDUINO 物联网
- 实验1.zip arduino跑马灯led灯实验,串口
- opencat所有资料.zip
- arduino主机,stm8从机。I2C测试 。每次
- DS18B20_Serial_println.ino
- ps2手柄arduino库文件
- 基于手机蓝牙的arduino遥控小车
- arduino中的can库函数
- 密码+指纹锁资料包.rar
- 贝壳物联arduino esp8266 demo版本
- HMC5883L罗盘指南针模块库文件及中英文
- arduino 小贱钟源码及教程
- Atom-TMC2208Pilot在Arduino上运行的应用程
- 写字机制作方案
- PID-增量式PID和位置式PID算法实现和
- Building Wireless Sensor Networks Using Arduin
- vc控制Arduino,实现串口通信
- Arduino入门经典
- Arduino所有库.zip
- 基于STM32和arduino的MPU9250九轴传感器代
- GY-9960模块Keil 和Arduino驱动程序
评论
共有 条评论