-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
88 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Simple LED on and off as a light.""" | ||
|
||
import circuitmatter as cm | ||
from circuitmatter.device_types.lighting import on_off | ||
|
||
import digitalio | ||
import board | ||
|
||
|
||
class LED(on_off.OnOffLight): | ||
def __init__(self, name, led): | ||
super().__init__(name) | ||
# self._led = led | ||
# self._led.direction = digitalio.Direction.OUTPUT | ||
|
||
def on(self): | ||
print("_led set to on") | ||
# self._led.value = True | ||
|
||
def off(self): | ||
print("_led set to on") | ||
# self._led.value = False | ||
|
||
|
||
matter = cm.CircuitMatter() | ||
#led = LED("led1", digitalio.DigitalInOut(board.D13)) | ||
led = LED("led1", None) | ||
matter.add_device(led) | ||
while True: | ||
matter.process_packets() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters