Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-STM32F103C8T6 OneWireCRC_LoRa_Node SX1276Lib_LoRa_Node
Thermometer.h@1:a54ff5e2c2f3, 2018-04-22 (annotated)
- Committer:
- lukas_formanek
- Date:
- Sun Apr 22 12:39:13 2018 +0000
- Revision:
- 1:a54ff5e2c2f3
- Parent:
- 0:cc04364f049a
- Child:
- 5:6e899f5db65e
22.4.2018
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lukas_formanek | 0:cc04364f049a | 1 | #ifndef THERMOMETER_H |
lukas_formanek | 0:cc04364f049a | 2 | #define THERMOMETER_H |
lukas_formanek | 0:cc04364f049a | 3 | |
lukas_formanek | 0:cc04364f049a | 4 | #include "mbed.h" |
lukas_formanek | 1:a54ff5e2c2f3 | 5 | #include "RFM95W.h" |
lukas_formanek | 0:cc04364f049a | 6 | #include "Board.h" |
lukas_formanek | 0:cc04364f049a | 7 | #include "DS18B20.h" |
lukas_formanek | 0:cc04364f049a | 8 | #include "DS18S20.h" |
lukas_formanek | 0:cc04364f049a | 9 | #include "OneWireDefs.h" |
lukas_formanek | 0:cc04364f049a | 10 | |
lukas_formanek | 0:cc04364f049a | 11 | #define THERMOMETER DS18B20 |
lukas_formanek | 0:cc04364f049a | 12 | #define THERMOMETER_CRC_ON true |
lukas_formanek | 0:cc04364f049a | 13 | #define THERMOMETER_USE_ADDR true |
lukas_formanek | 0:cc04364f049a | 14 | #define THERMOMETER_PARASITIC false |
lukas_formanek | 0:cc04364f049a | 15 | #define THERMOMETER_RESOLUTION twelveBit |
lukas_formanek | 0:cc04364f049a | 16 | |
lukas_formanek | 0:cc04364f049a | 17 | //#define MAX_MESSAGE_LENGTH |
lukas_formanek | 0:cc04364f049a | 18 | |
lukas_formanek | 0:cc04364f049a | 19 | class Thermometer |
lukas_formanek | 0:cc04364f049a | 20 | { |
lukas_formanek | 0:cc04364f049a | 21 | private: |
lukas_formanek | 0:cc04364f049a | 22 | THERMOMETER thermometer; /**< Teplomer na pine D6 */ |
lukas_formanek | 0:cc04364f049a | 23 | Ticker thermometerTicker; |
lukas_formanek | 0:cc04364f049a | 24 | volatile float meassuredValue; |
lukas_formanek | 0:cc04364f049a | 25 | // char messageToSend[] |
lukas_formanek | 0:cc04364f049a | 26 | |
lukas_formanek | 0:cc04364f049a | 27 | void OnSampleTick(); |
lukas_formanek | 0:cc04364f049a | 28 | public: |
lukas_formanek | 0:cc04364f049a | 29 | Thermometer(bool crcOn, bool useAddr, bool parasitic, PinName pin); |
lukas_formanek | 0:cc04364f049a | 30 | void Init(); |
lukas_formanek | 1:a54ff5e2c2f3 | 31 | void Meassure(); |
lukas_formanek | 0:cc04364f049a | 32 | void StartPeriodicMeassure(float timeSec); |
lukas_formanek | 0:cc04364f049a | 33 | |
lukas_formanek | 0:cc04364f049a | 34 | }; |
lukas_formanek | 0:cc04364f049a | 35 | |
lukas_formanek | 0:cc04364f049a | 36 | #endif |