Skip to content

Instantly share code, notes, and snippets.

@nasajpledu
Created November 19, 2020 17:52
Show Gist options
  • Select an option

  • Save nasajpledu/6e0ce243b17eeba7821ba3e0380e00e9 to your computer and use it in GitHub Desktop.

Select an option

Save nasajpledu/6e0ce243b17eeba7821ba3e0380e00e9 to your computer and use it in GitHub Desktop.
Build a Relay Inspired by Space Communications - Python Snippet Example
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