Skip to content

Instantly share code, notes, and snippets.

@nasajpledu
Created February 9, 2021 18:14
Show Gist options
  • Save nasajpledu/28dc1178c3d376ed79244627f1e5d871 to your computer and use it in GitHub Desktop.
Save nasajpledu/28dc1178c3d376ed79244627f1e5d871 to your computer and use it in GitHub Desktop.
Code a Mars Landing - Step 4: Transition between stages
from components import Buzzer
buzzer = Buzzer("D5")
if distance < 10:
red_led.on()
yellow_led.on()
green_led.on()
buzzer.on()
elif distance < 20:
red_led.off()
yellow_led.on()
green_led.on()
else:
red_led.off()
yellow_led.off()
green_led.on()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment