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@0:cc04364f049a, 2018-04-19 (annotated)
- Committer:
- lukas_formanek
- Date:
- Thu Apr 19 14:09:56 2018 +0000
- Revision:
- 0:cc04364f049a
- Child:
- 1:a54ff5e2c2f3
19.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 | 0:cc04364f049a | 5 | #include "Board.h" |
lukas_formanek | 0:cc04364f049a | 6 | #include "DS18B20.h" |
lukas_formanek | 0:cc04364f049a | 7 | #include "DS18S20.h" |
lukas_formanek | 0:cc04364f049a | 8 | #include "OneWireDefs.h" |
lukas_formanek | 0:cc04364f049a | 9 | |
lukas_formanek | 0:cc04364f049a | 10 | #define THERMOMETER DS18B20 |
lukas_formanek | 0:cc04364f049a | 11 | #define THERMOMETER_CRC_ON true |
lukas_formanek | 0:cc04364f049a | 12 | #define THERMOMETER_USE_ADDR true |
lukas_formanek | 0:cc04364f049a | 13 | #define THERMOMETER_PARASITIC false |
lukas_formanek | 0:cc04364f049a | 14 | #define THERMOMETER_RESOLUTION twelveBit |
lukas_formanek | 0:cc04364f049a | 15 | |
lukas_formanek | 0:cc04364f049a | 16 | //#define MAX_MESSAGE_LENGTH |
lukas_formanek | 0:cc04364f049a | 17 | |
lukas_formanek | 0:cc04364f049a | 18 | class Thermometer |
lukas_formanek | 0:cc04364f049a | 19 | { |
lukas_formanek | 0:cc04364f049a | 20 | private: |
lukas_formanek | 0:cc04364f049a | 21 | THERMOMETER thermometer; /**< Teplomer na pine D6 */ |
lukas_formanek | 0:cc04364f049a | 22 | Ticker thermometerTicker; |
lukas_formanek | 0:cc04364f049a | 23 | volatile float meassuredValue; |
lukas_formanek | 0:cc04364f049a | 24 | // char messageToSend[] |
lukas_formanek | 0:cc04364f049a | 25 | |
lukas_formanek | 0:cc04364f049a | 26 | void OnSampleTick(); |
lukas_formanek | 0:cc04364f049a | 27 | public: |
lukas_formanek | 0:cc04364f049a | 28 | Thermometer(bool crcOn, bool useAddr, bool parasitic, PinName pin); |
lukas_formanek | 0:cc04364f049a | 29 | void Init(); |
lukas_formanek | 0:cc04364f049a | 30 | void StartPeriodicMeassure(float timeSec); |
lukas_formanek | 0:cc04364f049a | 31 | |
lukas_formanek | 0:cc04364f049a | 32 | }; |
lukas_formanek | 0:cc04364f049a | 33 | |
lukas_formanek | 0:cc04364f049a | 34 | #endif |