-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from acremonezi/19-2005869-add-display-capabil…
…ity-2 display capability + some stuff
- Loading branch information
Showing
5 changed files
with
225 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#include <Arduino.h> // Main Arduino Library | ||
#include "pinSettings.h" // Pin Settings Setup | ||
|
||
// Features | ||
#include "sensors/DHTxx.h" // DHTxx Sensor Code | ||
|
||
|
||
//Display | ||
#include <Wire.h> | ||
#include "SSD1306Wire.h" | ||
#include <stdio.h> | ||
#include <iostream> | ||
#include <string.h> | ||
|
||
|
||
// vars to use with display | ||
String textTemperatureComplete; | ||
String textHumidityComplete; | ||
String textMACComplete; | ||
|
||
|
||
SSD1306Wire display(0x3c, D6, D5, GEOMETRY_128_64); | ||
|
||
|
||
void startDisplay() | ||
{ | ||
display.init(); | ||
display.flipScreenVertically(); | ||
} | ||
|
||
|
||
void refreshDisplay() | ||
{ | ||
// display lines | ||
delay(2000); | ||
display.clear(); // only first time in loop | ||
display.setTextAlignment(TEXT_ALIGN_LEFT); | ||
|
||
// MACADRESS | ||
display.setFont(ArialMT_Plain_10); | ||
textMACComplete += espClientMAC; | ||
if (textMACComplete == "") | ||
{ | ||
textMACComplete += "Not Conected"; | ||
} | ||
display.drawString(10, 0, textMACComplete); | ||
Serial.print("MACADRESS: "); | ||
Serial.println(textMACComplete); | ||
display.display(); | ||
textMACComplete = ""; | ||
|
||
// Temperature | ||
display.setFont(ArialMT_Plain_16); | ||
|
||
|
||
|
||
textTemperatureComplete += DHTxxTemperature; | ||
textTemperatureComplete += " ºC"; | ||
display.drawString(20, 20, textTemperatureComplete); | ||
display.display(); | ||
textTemperatureComplete = ""; | ||
|
||
// Humidity | ||
display.setFont(ArialMT_Plain_16); | ||
|
||
textHumidityComplete += DHTxxHumidity; | ||
textHumidityComplete += " %"; | ||
display.drawString(70, 40, textHumidityComplete); | ||
display.display(); | ||
textHumidityComplete = ""; | ||
|
||
Serial.println(textTemperatureComplete); | ||
Serial.println(textHumidityComplete); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters