Files
2026-09-03 09:41:37 +08:00

28 lines
616 B
Python

"""Run independently and keep A24 at a high logic level."""
from maix import app, gpio, pinmap, time
PIN = "P19"
GPIO_NAME = "GPIOP19"
def main():
pinmap.set_pin_function(PIN, GPIO_NAME)
output = gpio.GPIO(GPIO_NAME, gpio.Mode.OUT)
output.value(1)
print(f"{PIN} is HIGH. Stop the script to set it LOW.")
try:
while not app.need_exit():
# Refresh the output in case another component changes its state.
output.value(1)
time.sleep_ms(100)
finally:
output.value(0)
print(f"{PIN} is LOW.")
if __name__ == "__main__":
main()