Code
/*
keyestudio ESP32 ESP32 Inventor Learning Kit
Project 23.2 Smart Cup
http://www.keyestudio.com
*/
#include
<xht11.h>
xht11 xht(26);
unsigned char
dat[4]
humidity data
int
yellow_led
=
13;
int
green_led
=
14;
int
blue_led
=
27;
int
temperature
=
0;
void
setup() {
// put your setup code here, to run once:
pinMode(red_led, OUTPUT);
pinMode(green_led, OUTPUT);
pinMode(blue_led, OUTPUT);
pinMode(yellow_led, OUTPUT);
Serial.begin(9600);
}
8.5. Arduino Project
//Define DHT11 to pin IO26
=
{ 0, 0, 0,
0
};
//Define an array to store temperature
//Define yellow_led to io13
//Define green_led to io14
//Define blue_led to io27
//Set a variable to save the temperature value
//Set io12 to ouput
//Set io13 to ouput
//Set io14 to ouput
//Set io27 to ouput
ESP32 Starter Kit
and␣
(continues on next page)
131
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?
Questions and answers