feat: use oled screen lib
This commit is contained in:
parent
f2bd530d4e
commit
b0c90360b8
@ -10,6 +10,7 @@
|
||||
#include "Ultrason.h"
|
||||
#include "HumiTemp.h"
|
||||
#include "Balance.h"
|
||||
#include "OledScreen.h"
|
||||
|
||||
class Program{
|
||||
public:
|
||||
@ -46,6 +47,12 @@ private:
|
||||
*/
|
||||
Capteur *balance;
|
||||
|
||||
/**
|
||||
* @brief OledScreen
|
||||
*
|
||||
*/
|
||||
OledScreen* screen;
|
||||
|
||||
/**
|
||||
* @brief Réference de l'API pour les calls
|
||||
*
|
||||
|
@ -6,6 +6,10 @@ Program::Program(){
|
||||
Serial1.begin(MONITOR_SPEED);
|
||||
Serial.begin(MONITOR_SPEED);
|
||||
|
||||
//////Oled Screen/////
|
||||
this->screen = new OledScreen(OLED_WIDTH, OLED_HEIGHT, OLED_RESET);
|
||||
this->screen->wifiWaiting();
|
||||
|
||||
////////API///////
|
||||
this->api = new API(USER_NAME, USER_PASSWORD, API_HOST);
|
||||
this->api->wifiBegin(WIFI_SSID, WIFI_PASSWORD, &Serial1);
|
||||
@ -16,12 +20,17 @@ Program::Program(){
|
||||
this->dht = new HumiTemp(DHTPIN, DHTTYPE, DHT_FULL);
|
||||
this->balance = new Balance(POID_DOUT,POID_SCK, POID_FULL);
|
||||
this->balance->tar(1077);
|
||||
|
||||
this->screen->clear();
|
||||
}
|
||||
|
||||
void Program::loop(){
|
||||
String distance = this->ultrasonic->read();
|
||||
String humitemp = this->dht->read();
|
||||
String poid = this->balance->read();
|
||||
|
||||
|
||||
this->screen->printVal(distance, poid, humitemp);
|
||||
|
||||
this->api->sendValue(distance, TRASHCAN_ONE, this->ultrasonic->getValType(), this->ultrasonic->isFull());
|
||||
Serial.print("Distance in CM = " + distance);
|
||||
|
Loading…
x
Reference in New Issue
Block a user