UIFlow Guide
Print the analog value and voltage of the pin, then set the DC motor to run at maximum speed every second, and the servo to switch back and forth between 0° and 180°.
from m5stack import *
from m5ui import *
from uiflow import *
import module
import time
setScreenColor(0x222222)
go_plus = module.get(module.GOPLUS)
go_plus.set_motor_speed(1, 0)
while True:
print(go_plus.digital_read(go_plus.PB1, 0))
print(go_plus.analog_read(go_plus.PB1))
go_plus.set_motor_speed(1, 0)
go_plus.set_servo(0, 0)
wait(1)
go_plus.set_motor_speed(1, 127)
go_plus.set_servo(0, 180)
wait(1)
wait_ms(2)
go_plus.analog_read(go_plus.PB1)
go_plus.digital_read(go_plus.PB1, 0)
go_plus.set_motor_speed(1, 0)
go_plus.set_servo(0, 0)