CircuitPython to read user input from REPL

A simple way to read user input from REPL is input()

while True:
    user_input = input("Enter something:")
    # note: input() is a blocking function
    # it will not return untill user press "ENTER"
    if user_input == "":
        print("~ bye ~")
        break
    else:
        print("You enter=", user_input)


Comments

Popular posts from this blog

480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

Drive ST7796 SPI TFT with XPT2046 Touch on ESP32-C3-DevKitM-1 (arduino-esp32), using TFT_eSPI.