EasyManua.ls Logo

Keyestudio ESP32 - 3. 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
2. Wiring Diagram
3. Test Code
A water flow light means that LED lights go from left to right and then from right to left. In this experiment, we use
continuous pins, so that “for” statement can be utilized not only to set output mode (replace pins with circular variable
in code) but to output.
/*
keyestudio ESP32 Inventor Learning Kit
Project 6 Water Flow Light
http://www.keyestudio.com
*/
void setup() {
for(int i = 12;i <= 15 ;i++){ //Use "for" loop statement to set IO12-IO15 pin to
˓output mode
pinMode(i,OUTPUT);
}
}
void loop() {
for(int i = 12; i <= 15; i++){ //Use "for" loop statement to light up
˓LED on IO12-IO15 pin in sequence
(continues on next page)
8.5. Arduino Project 61

Table of Contents