SunFounder ESP32 Starter Kit
• If the current guess (count) is lower than the secret number, the lower bound is updated.
• If the current guess (count) is equal to the secret number, the function returns True (game over).
5. This function processes the key press events received from the IR remote.
def process_key(key):
global count, lower, upper, pointValue, result
if key == "Power":
init_new_value()
lcd_show(False)
elif key == "+":
result = number_processing()
lcd_show(result)
if result:
time.sleep(5)
init_new_value()
lcd_show(False)
else:
lcd_show(False)
elif key.isdigit():
count = count * 10 + int(key) if count * 10 + int(key) <= 99 else␣
˓→count
lcd_show(False)
• If the Power key is pressed, the game is reset.
• If the + key is pressed, the current guess (count) is processed and the game status is updated.
• If a digit key is pressed, the current guess (count) is updated with the new digit.
6. This callback function is triggered when the IR receiver receives
def callback(data, addr, ctrl):
if data < 0:
pass
else:
key = decodeKeyValue(data)
if key != "ERROR":
process_key(key)
3.40 6.8 Plant Monitor
Welcome to the Plant Monitor project!
In this project, we will be using an ESP32 board to create a system that helps us take care of our plants. With this
system, we can monitor the temperature, humidity, soil moisture, and light levels of our plants, and ensure that they are
getting the care and attention they need to thrive.
Required Components
In this project, we need the following components.
It’s definitely convenient to buy a whole kit, here’s the link:
3.40. 6.8 Plant Monitor 439