two !
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""Run independently and keep A24 at a high logic level."""
|
||||
|
||||
from maix import app, gpio, pinmap, time
|
||||
|
||||
|
||||
PIN = "A17"
|
||||
GPIO_NAME = "GPIOA17"
|
||||
|
||||
|
||||
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()
|
||||
Reference in New Issue
Block a user