Tags:
tag this topic
create new tag
view all tags
---+ La barre d'affichage LED ---++ Introduction Cet exercice fait marcher la barre d’affichage LED. <img alt="ledBar.png" height="339" src="%ATTACHURL%/ledBar.png" title="ledBar.png" width="449" /> Avant de commencer, vérifier la polarité des !LEDs : Connecter un pin sur 3.3V et le pin en face à la masse via une résistance de 330 <font face="Liberation Serif, serif">Ω</font><font face="Liberation Serif, serif"> ou 220 </font><font face="Liberation Serif, serif">Ω</font><font face="Liberation Serif, serif">. Avec une résistance de 330 </font><font face="Liberation Serif, serif">Ω, un courant de 10 mA passe à travers chaque LED. </font><font face="Liberation Serif, serif">Il en </font><font face="Liberation Serif, serif">résulte </font><font face="Liberation Serif, serif">une intensité</font><font face="Liberation Serif, serif"> totale de</font><font face="Liberation Serif, serif"> courant </font><font face="Liberation Serif, serif">de 100 mA, si toutes les !LEDs sont allumé</font><font face="Liberation Serif, serif">es</font><font face="Liberation Serif, serif">. Une telle </font><font face="Liberation Serif, serif">intensité</font><font face="Liberation Serif, serif"> peut être fourni</font><font face="Liberation Serif, serif">e</font><font face="Liberation Serif, serif"> par l’alimentation de la porte USB. <br /> Si la LED ne marche pas, inverse</font><font face="Liberation Serif, serif">r</font><font face="Liberation Serif, serif"> les pins.</font> ---++ Exercice 1: Connecter toutes les !LEDs. Reprendre le programme de la LED clignotante de la dernière session et changer le pin GPIO, afin de vérifier que chaque LED peut être contrôlée. ---++ Exercice 2: Écrire un script-python, qui fait clignoter chaque LED, une à une pendant 5s. Comment peut-on définir la connexion des !LEDs au début du programme de telle sorte qu’on puisse adapter facilement le code, si les connexions changent ? (par exemple, si une autre carte CPU est utilisée) <u>Indice</u> : Regarder les possibilités de « dict ». ---++ Exercice 3: Écrire une classe « !ShiftLed.py » qui allume et éteint successivement chaque LED. La direction (droite à gauche ou gauche à droite) ainsi que la vitesse doivent être programmable. La version.odt de la feuille d'exercices: %ATTACHURL%/ledBar.odt -- %USERSIG{UliRaich - 2021-06-27}% ---++ Comments %COMMENT%
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
odt
ledBar.odt
r1
manage
136.2 K
2021-06-27 - 10:33
UliRaich
png
ledBar.png
r1
manage
116.0 K
2021-06-27 - 10:30
UliRaich
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 2021-06-27
-
UliRaich
Home
Site map
AFNOG web
Embedded_Systems web
IoT_Course_English web
IoT_Course_French web
Main web
Sandbox web
TWiki web
IoT_Course_French Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback