Skip to content

Commit ed44d24

Browse files
committed
🚧 WIP, dsx - Plumbing for ds18x in App, switch to OneWireNG interface
1 parent 81296f6 commit ed44d24

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ lib_deps =
7171
adafruit/Adafruit TouchScreen
7272
adafruit/Adafruit MQTT Library
7373
bblanchon/ArduinoJson
74-
https://github.com/PaulStoffregen/OneWire.git
75-
https://github.com/milesburton/Arduino-Temperature-Control-Library.git
74+
https://github.com/pstolarz/OneWireNg.git
75+
https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#OneWireNg
7676
https://github.com/Sensirion/arduino-sht.git
7777
https://github.com/Sensirion/arduino-i2c-scd4x.git
7878
https://github.com/Sensirion/arduino-i2c-sen5x.git

src/Wippersnapper_V2.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Wippersnapper_V2::Wippersnapper_V2() {
7171
// Initialize controller classes
7272
WsV2.digital_io_controller = new DigitalIOController();
7373
WsV2.analogio_controller = new AnalogIOController();
74+
WsV2._ds18x20_controller = new DS18X20Controller();
7475
};
7576

7677
/**************************************************************************/

src/Wippersnapper_V2.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "protos/checkin.pb.h"
3333
#include "protos/digitalio.pb.h"
3434
#include "protos/signal.pb.h"
35+
#include "protos/ds18x20.pb.h"
3536

3637
// External libraries
3738
#include "Adafruit_MQTT.h" // MQTT Client
@@ -52,6 +53,7 @@
5253
#include "components/sensor/model.h"
5354
#include "components/digitalIO/controller.h"
5455
#include "components/analogio/controller.h"
56+
#include "components/ds18x20/controller.h"
5557

5658

5759
// Components (API v1)
@@ -114,6 +116,7 @@ class CheckinModel;
114116
class SensorModel;
115117
class DigitalIOController;
116118
class AnalogIOController;
119+
class DS18X20Controller;
117120

118121
/**************************************************************************/
119122
/*!
@@ -220,6 +223,7 @@ class Wippersnapper_V2 {
220223
DigitalIOController
221224
*digital_io_controller; ///< Instance of DigitalIO controller class
222225
AnalogIOController *analogio_controller; ///< Instance of AnalogIO controller
226+
DS18X20Controller *_ds18x20_controller; ///< Instance of DS18X20 controller
223227

224228
// TODO: does this really need to be global?
225229
uint8_t _macAddrV2[6]; /*!< Unique network iface identifier */

src/components/ds18x20/hardware.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@
1515
#ifndef WS_DS18X20_HARDWARE_H
1616
#define WS_DS18X20_HARDWARE_H
1717
#include "Wippersnapper_V2.h"
18-
#include <DallasTemperature.h>
1918

2019
struct DS18X20_Pin {
2120
// Specific to the DS18X20 sensor object
22-
OneWire
23-
*oneWire; ///< Ptr reference to the OneWire bus object used by this pin
24-
DallasTemperature
25-
*dallasTempObj; ///< Pointer to a DallasTemperature sensor object
26-
DeviceAddress dallasTempAddr; ///< Temperature sensor's address
21+
// TODO: Implement this!
2722
// From the PB model
2823
char onewire_pin[5]; ///< Pin utilized by the OneWire bus, used for addressing
2924
float period; ///< The desired period to read the sensor, in seconds
@@ -44,7 +39,6 @@ class DS18X20Hardware {
4439
public:
4540
DS18X20Hardware();
4641
~DS18X20Hardware();
47-
4842
private:
4943
std::vector<DS18X20_Pin> _DS18X20_Pins; ///< Vector of analogio pins
5044
};

0 commit comments

Comments
 (0)