/MakerUnoDHT11Alph.ino Secret
Created
April 14, 2022 01:17
Star
You must be signed in to star a gist
This is the code for the Maker Uno DHT11 Alphanumeric Display
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
1#include <Wire.h> | |
#include "grove_alphanumeric_display.h" | |
#include "DHT.h" | |
#define DHTPIN 2 // what digital pin we're connected to | |
#define DHTTYPE DHT11 // DHT 11 | |
Seeed_Digital_Tube tube; | |
DHT dht(DHTPIN, DHTTYPE); | |
void setup() { | |
// put your setup code here, to run once: | |
Wire.begin(); | |
dht.begin(); | |
tube.setTubeType(TYPE_4,TYPE_4_DEFAULT_I2C_ADDR); | |
tube.setBrightness(10); | |
tube.setBlinkRate(BLINK_OFF); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
welcome(); | |
float h = dht.readHumidity(); | |
// Read temperature as Celsius (the default) | |
float t = dht.readTemperature(); | |
tube.displayString("Humidity: ",100); | |
tube.displayNum(h,100); | |
delay(500); | |
tube.displayString("Temperature: ", 100); | |
tube.displayNum(t,100); | |
delay(500); | |
tube.displayString("°C ", 100); | |
delay(500); | |
} | |
void welcome() | |
{ | |
tube.displayString("MAKER UNO + DHT11 + ALPHA DISPLAY", 100); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment