1 677 octets ajoutés
, 30 septembre 2013 à 09:50
{{Pi-WiringPi-NAV}}
== Intro ==
{{bloc-etroit|text=Once I’d soldered it and checked to make sure no solder bridges, etc. I plugged it in to do some testing.
The main board has an LED and a button and these can be optionally jumpered into the GPIO pins. The two jumper links next to the LED and button need to be present to use them.
To test, make sure [[Pi-WiringPi-Installation|wiringPi est installé]] }}
== Tester le module principal ==
The button is connected to pin 0 and the LED to pin 1 du GPIO. The button is wired so that the input reads 1 when you push the button.
Placer les cavalier de façon a rendre la LED et le bouton fonctionnel. Ensuite:
<nowiki>gpio mode 0 in # Button pin 0
gpio mode 1 out # LED pin 1
while true; do gpio write 1 `gpio read 0`; done</nowiki>
Pushing the button should light the LED. If not, then check each one individually:
<nowiki>gpio write 1 1 # LED on
gpio write 1 0 # LED off</nowiki>
and for the button:
<nowiki>gpio read 0</nowiki>
should return 1 when you push the button, otherwise 0.
At the bottom of the main board is the external GPIO connector as well as some power and ground pins. The GPIO outputs have series resistors, so can be connected directly to LEDs – I connected an LED between 0v and pin7.
[[Fichier:Pi-WiringPi-Exemple-Quick2Wire-Install.jpg|640px]]<br /><small>Source: [http://wirinPi.com wiringPi.com]</small>
Exécutez ensuite le code suivant:
<nowiki>gpio mode 7 out
while true; do gpio write 7 `gpio read 0`; done</nowiki>
and used the button to toggle the LED on pin 7 in the same way as above.
<nowiki></nowiki>
<nowiki></nowiki>
<nowiki></nowiki>
{{Pi-WiringPi-TRAILER}}