When not running on a Pi, the dispenser will be an empty object and no calls will be made with it. Update Arduino blink test
22 lines
461 B
Python
22 lines
461 B
Python
"""
|
|
Blink an LED on digital pin 13 in 1 second intervals
|
|
"""
|
|
|
|
from Arduino import Arduino # type: ignore [import-untyped]
|
|
import time
|
|
|
|
# Arduino plugged in via USB, serial com at rate 115200
|
|
board = Arduino()
|
|
board.pinMode(3, "OUTPUT")
|
|
|
|
# Set a pin to simulate ground
|
|
board.pinMode(4, "OUTPUT")
|
|
board.digitalWrite(4, "LOW")
|
|
|
|
while True:
|
|
# Blink LED
|
|
board.digitalWrite(3, "LOW")
|
|
time.sleep(5.0)
|
|
board.digitalWrite(3, "HIGH")
|
|
time.sleep(0.4)
|