diff --git a/draft/boards/modmypi-jamhat.png b/draft/boards/modmypi-jamhat.png new file mode 100644 index 0000000..d942207 Binary files /dev/null and b/draft/boards/modmypi-jamhat.png differ diff --git a/draft/overlay/modmypi-jamhat.md b/draft/overlay/modmypi-jamhat.md new file mode 100644 index 0000000..49283d5 --- /dev/null +++ b/draft/overlay/modmypi-jamhat.md @@ -0,0 +1,95 @@ + +#Jam Hat + +An LED, button and buzzer hat ideal for Raspberry Jams and people learning the basics of GPIO. + +``` +from gpiozero import JamHat +from time import sleep + +jh = JamHat() + +# Turn the hat on, wait and turn it off. +jh.on() +sleep(1) +jh.off() + +# Play tones through the buzzer. +jh.buzzer.play('C4') +sleep(0.5) +jh.buzzer.play('D4') +sleep(0.5) +jh.buzzer.play('E4') +sleep(0.5) +jh.off() + +# Use the buttons to turn on lights. +jh.button_1.when_pressed = jh.lights_1.on +jh.button_1.when_released = jh.lights_1.off +jh.button_2.when_pressed = jh.lights_2.on +jh.button_2.when_released = jh.lights_2.off +```