资源简介
这是配套的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,绿色版
相关资源
- Arduino 步进电机接线方法含有代码
- 四位数码管+DS3231做电子时钟源码.in
- arduino控制57步进电机
- 使用Processing+Arduino写的类似雷达扫描
- arduino上阿里云所需要用到的四个库文
- 基于Arduino的DHT11库文件
- Arduino-DHT11温湿度传感器库文件
- ESP8266(arduino)连接阿里云物联网平台
- TCS3200颜色传感器Arduino优化代码快速识
- avrdude-GUI 1.0.5
- arduino程序,用两个红外线传感器来判
- PID巡线,arduino
- ArduinoUSBKeyboard库文件
- arduino DS3231库
- Arduino串口转发源代码
- arduino+rc522读写卡
- arduino_code.rar
- arduino和ds1302的基于lcd12864闹钟,按键
- Arduino-TMC2130Stepper.zip
- Arduino-smartcar_shield.zip
- 基于arduino的温度检测和显示
- TFmini_Plus I²C版在Arduino上的例程及参考
- pid算法-arduino
- HidEmuKbd.bin
- arduino编程库函数合集
- arduino JSON数据格式库
- proteus arduino仿真库
- arduino 多个程序一起工作程序
- arduino蜂鸣器和光控灯实验报告
- Arduino自动浇花系统_一路继电器控制水
评论
共有 条评论