MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeTemperature.h
Go to the documentation of this file.
1
40#ifndef MeTemperature_H
41#define MeTemperature_H
42
43#include <stdint.h>
44#include <stdbool.h>
45#include <Arduino.h>
46#include "MeConfig.h"
47#include "MeOneWire.h"
48
49#ifdef ME_PORT_DEFINED
50#include "MePort.h"
51#endif /* ME_PORT_DEFINED */
52
53/* DS18B20 commands */
54#define STARTCONVO 0x44 // Tells device to take a temperature reading and put it on the scratchpad
55#define COPYSCRATCH 0x48 // Copy EEPROM
56#define READSCRATCH 0xBE // Read EEPROM
57#define WRITESCRATCH 0x4E // Write to EEPROM
58#define RECALLSCRATCH 0xB8 // Reload from last known
59#define READPOWERSUPPLY 0xB4 // Determine if device needs parasite power
60#define ALARMSEARCH 0xEC // Query bus for devices with an alarm condition
61
67#ifndef ME_PORT_DEFINED
68 class MeTemperature
69#else // !ME_PORT_DEFINED
70class MeTemperature : public MePort
71#endif // !ME_PORT_DEFINED
72{
73 public:
74#ifdef ME_PORT_DEFINED
81 MeTemperature(void);
82
89 MeTemperature(uint8_t port);
90
98 MeTemperature(uint8_t port, uint8_t slot);
99#else // ME_PORT_DEFINED
105 MeTemperature(uint8_t port);
106#endif // ME_PORT_DEFINED
122 void reset(uint8_t port);
123
140 void reset(uint8_t port, uint8_t slot);
141
156 void setpin(uint8_t port);
157
170 float temperature(void);
171 private:
172 MeOneWire _ts;
173 volatile uint8_t _DataPin;
174};
175
176#endif
177
MeConfig.h
Configuration file of library.
MeOneWire.h
Header for MeOneWire.cpp module.
MePort.h
Header for MePort.cpp module.
MeOneWire
Driver for 1-wire protocol.
Definition MeOneWire.h:153
MePort
Port Mapping for RJ25.
Definition MePort.h:128
MeTemperature
Driver for temperature sensor device.
Definition MeTemperature.h:72
MeTemperature::MeTemperature
MeTemperature(void)
Definition MeTemperature.cpp:51
MeTemperature::setpin
void setpin(uint8_t port)
Definition MeTemperature.cpp:151
MeTemperature::temperature
float temperature(void)
Definition MeTemperature.cpp:169
MeTemperature::reset
void reset(uint8_t port)
Definition MeTemperature.cpp:109