EasyManuals Logo

SunFounder ESP32 User Manual

Default Icon
771 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #443 background imageLoading...
Page #443 background image
SunFounder ESP32 Starter Kit
(continued from previous page)
if data == 0x40:
return "BACKWARD"
if data == 0x45:
return "POWER"
if data == 0x47:
return "MUTE"
if data == 0x46:
return "MODE"
return "ERROR"
def callback(data, addr, ctrl):
if data < 0:
pass
else:
key = decodeKeyValue(data)
if key != "ERROR":
process_key(key)
# Initialize the IR receiver object with the callback function
ir = NEC_8(pin_ir, callback)
# ir.error_function(print_error)
# Initialize the game with a new random value
init_new_value()
# Show the initial game state on the LCD
lcd_show(False)
try:
while True:
pass
except KeyboardInterrupt:
ir.close()
When the code runs, a secret number is produced but not displayed on the LCD, and what you need to do is to
guess it.
Press the number you guessed on the remote control, then press the + key to confirm.
Simultaneously, the range shown on the I2C LCD1602 will decrease, and you must press the appropriate number
based on this new range.
If you got the lucky number luckily or unluckily, there will appear GAME OVER!.
Note: If the code and wiring are correct, but the LCD still fails to display any content, you can adjust the potentiometer
on the back to increase the contrast.
How it works?
The following is a detailed analysis of part of the code.
1. Initialize the guessing game variables.
3.39. 6.7 Guess Number 437

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

SunFounder ESP32 Specifications

General IconGeneral
BrandSunFounder
ModelESP32
CategoryController
LanguageEnglish