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@5:6e899f5db65e, 2018-04-30 (annotated)
- Committer:
- lukas_formanek
- Date:
- Mon Apr 30 17:10:02 2018 +0000
- Revision:
- 5:6e899f5db65e
- Parent:
- 1:a54ff5e2c2f3
- Child:
- 6:531b8dccca06
30.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 | 5:6e899f5db65e | 25 | volatile int intervalSeconds; |
| lukas_formanek | 5:6e899f5db65e | 26 | volatile int counter; |
| lukas_formanek | 0:cc04364f049a | 27 | // char messageToSend[] |
| lukas_formanek | 0:cc04364f049a | 28 | |
| lukas_formanek | 0:cc04364f049a | 29 | void OnSampleTick(); |
| lukas_formanek | 0:cc04364f049a | 30 | public: |
| lukas_formanek | 0:cc04364f049a | 31 | Thermometer(bool crcOn, bool useAddr, bool parasitic, PinName pin); |
| lukas_formanek | 0:cc04364f049a | 32 | void Init(); |
| lukas_formanek | 1:a54ff5e2c2f3 | 33 | void Meassure(); |
| lukas_formanek | 5:6e899f5db65e | 34 | void StartPeriodicMeassure(int seconds); |
| lukas_formanek | 5:6e899f5db65e | 35 | void StopPeriodicMeassure(); |
| lukas_formanek | 0:cc04364f049a | 36 | }; |
| lukas_formanek | 0:cc04364f049a | 37 | |
| lukas_formanek | 5:6e899f5db65e | 38 | extern Thermometer thermometer; |
| lukas_formanek | 5:6e899f5db65e | 39 | |
| lukas_formanek | 0:cc04364f049a | 40 | #endif |