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

my dev.tools - FNIRSI 2C23T 3-in-1 Dual Channel Oscilloscope/Multimeter/Signal Generator