group

parent 4aad8d42
Pipeline #77100 passed with stage
in 21 seconds
from gpiozero import LED
from time import sleep
led=LED(7)
while True:
led.on()
sleep(1)
led.off()
sleep(1)
\ No newline at end of file
from gpiozero import LED
from time import sleep
led=LED(7)
while True:
led.on()
sleep(1)
led.off()
sleep(1)</pre></code>
Another code is a push button with one led.
<pre><code>from gpiozero import LED, Button
from signal import pause
led=LED(7)
button=Button(27)
button.when_pressed=led.off
button.when_released=led.on
pause()
\ No newline at end of file
......@@ -224,7 +224,36 @@ int main (void)
I even modified the platformio.ini file with the communication protocol, but I did not have the expected results.
<a title="PlatformIO"><img class="image center" src="images/week9/platformio.jpg"></a>
<br><h2>Group assignment</h2>
For the group assignment, we use a Raspberry Pi Zero W, my contribution was the programming of that board.
The laboratory has some digitals inputs(3 buttons) and digital outputs(3 leds).<br>
After reading the pin connection of the raspberry, this is the connection of the board and raspberry.
<a title="Raspberry connection"><img class="image center" src="images/week9/raspconection.jpg"></a>
For the programming I base from<a href="https://www.tunnelsup.com/raspberry-pi-zero-blink-an-led-using-gpio-pins/"> this tutorial</a> and this is the code:
<pre><code>from gpiozero import LED
from time import sleep
led=LED(7)
while True:
led.on()
sleep(1)
led.off()
sleep(1)</pre></code>
Another code is a push button with one led.
<pre><code>from gpiozero import LED, Button
from signal import pause
led=LED(7)
button=Button(27)
button.when_pressed=led.off
button.when_released=led.on
pause()</pre></code>
This video is from the blink code.<br>
<iframe width="560" height="315" src="https://www.youtube.com/embed/nUYzZN2QYvs" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</p>
<p>
......@@ -238,7 +267,9 @@ int main (void)
<a href="images/week9/blinkC.ino" download>Blink C++</a><br>
Platformio<br>
<a href="images/week9/attiny.rar" download>Blink Atom</a><br>
Raspberry<br>
<a href="images/week9/blink.py" download>Blink Raspberry</a><br>
<a href="images/week9/button.py" download>Button Raspberry</a><br>
</p>
<p><ul class="actions">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment