Refactor Sensors to remove publish responsibility and instead return values. Add Screen class to output to OLED screen.
This commit is contained in:
parent
12e756fef1
commit
d51b140050
5 changed files with 81 additions and 27 deletions
21
Screen.h
Normal file
21
Screen.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef Screen_h
|
||||
#define Screen_h
|
||||
|
||||
#include <Wire.h>
|
||||
#include <Adafruit_SSD1306.h>
|
||||
#include "Sensors.h"
|
||||
|
||||
class Screen {
|
||||
Adafruit_SSD1306 _screen=Adafruit_SSD1306(128, 64, &Wire, -1);
|
||||
Sensors *_sensors;
|
||||
int _sdaPin, _sclPin;
|
||||
|
||||
void writeTemperature();
|
||||
|
||||
public:
|
||||
Screen(Sensors *sensors, int sdaPin, int sclPin);
|
||||
void setup();
|
||||
void update();
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue