
In this tutorial we will see how to read the temperature measured by the DTH11 sensor and display it on a TM1637 display with Arduino.
To make the assembly, we can connect :
Here is the program that reads the temperature measured by the DTH11 sensor and displays it on a TM1637 display:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#include <dht11.h> #include <TM1637Display.h> #define DHT11PIN 1 // broche DATA -> pin 1 dht11 DHT11; // Module connection pins (Digital Pins) #define CLK 2 #define DIO 3 TM1637Display display(CLK, DIO); void setup() { display.setBrightness(0x0f); } void loop() { DHT11.read(DHT11PIN); display.showNumberDec((float)DHT11.temperature); // Display Temperature in TM1637 Display } |