Keyestudio ESP32 Manual page 100

Starter kit
Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

ESP32 Starter Kit
//set the pin connecting with button to input
pinMode(res,INPUT);
pinMode(add,INPUT);
pinMode(subtract,INPUT);
for(char
b=0;b<4;b++){
DigitalTube.clearBit(b);
}
}
void
loop(){
DigitalTube.displayFloatNum(item);//Digital tube displays item value
int
red_key
=
digitalRead(res);
int
yellow_key
=
digitalRead(subtract);
int
green_key
=
digitalRead(add);
if(green_key
==
0){
item++;
//operate to add 1, item = item + 1
delay(200);
}
if(yellow_key
==
item--;
delay(200);
}
if(red_key
==
0){
item
=
0;
delay(200);
}
if
(item
>
9999) {
range)
item
=
0;
}
}
4. Test Result
After connecting the wiring and uploading code, press green button to add 1, yellow to minus 1, and red to reset. Press
the button and hold it, and the displayed value will keep adding or reducing.
8.5.16 Project 15: Responder
1. Description
This programmable responder inputs and receives signals through Arduino development board and a group of buttons,
and it judges the correctness of answers via a LED. It is a good object to exercise students' reaction ability and draw
their attention to questions. If the answer is correct, the respondent obtains a lot scores.
Moreover, it simplifies teachers' manipulation of question-grabbers and cuts answer clutters. It may even stimulate
students' interests in learning.
96
//DigitalTube.clearBit(0 to 3); Clear bit display.
0){
//operate to reduce 1, item = item - 1
//return to zero when greater than 9999(excessing the
//Red button is the reset button
//Yellow button is minus 1
//Green button is plus 1
Chapter 8. Arduino Tutorial
(continued from previous page)
display␣

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Related Products for Keyestudio ESP32

Table of Contents

Save PDF