EasyManua.ls Logo

Keyestudio ESP32 - 4. Test Code

Keyestudio ESP32
344 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ESP32 Starter Kit
3. Wiring Diagram
4. Test Code
Imagine a question-master and three respondents. Respondents are allowed to grab questions only when the master
presses the red button. Otherwise, their replies are invalid and lights are all off. Plus, if one of the three presses his/her
button, the remaining two buttons are also invalid.
/*
keyestudio ESP32 Inventor Learning Kit
Project 15 Responder
http://www.keyestudio.com
*/
int blue_key = 16; //Set blue button to connect pin D3
int green_key= 17; //Set green button to connect pin D4
int yellow_key = 18; //Set yellow button to connect pin D5
int red_key = 19; //Set red button to connect pin D6
int blue_led = 12; //Set blue LED to connect pin D7
int green_led = 13; //Set green LED to connect pin D8
int yellow_led = 14; //Set yellow LED to connect pin D9
int red_led = 27; //Set red LED to connect pin D10
(continues on next page)
98 Chapter 8. Arduino Tutorial

Table of Contents