-
-
Save nasajpledu/6e0ce243b17eeba7821ba3e0380e00e9 to your computer and use it in GitHub Desktop.
Build a Relay Inspired by Space Communications - Python Snippet Example
This file contains hidden or 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
| from ptpma.components import PMALightSensor, PMABuzzer | |
| from time import sleep | |
| lightsensor = PMALightSensor('A1') | |
| buzzer = PMABuzzer('A2') | |
| while True: | |
| print(lightsensor.reading) | |
| sleep(0.1) | |
| if lightsensor.reading > 300: | |
| buzzer.on() | |
| print('Receiving Signal') | |
| else: | |
| buzzer.off() | |
| print('...') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment