Add buzzer and led support

This commit is contained in:
2026-01-04 20:42:52 +01:00
parent 16f354ad60
commit b2ce505c27
6 changed files with 44 additions and 1 deletions

View File

15
rpi/hardware/led/led.py Normal file
View File

@@ -0,0 +1,15 @@
import grovepi
class Led:
_pin : int
def __init__(self, pin : int):
self._pin = pin
grovepi.pinMode(self._pin, "OUTPUT")
def on(self):
grovepi.digitalWrite(self._pin, 1)
def off(self):
grovepi.digitalWrite(self._pin, 0)