Modifications

Sauter à la navigation Sauter à la recherche
375 octets ajoutés ,  21 février 2018 à 20:59
Ligne 1 : Ligne 1 :  
== Introduction ==  
 
== Introduction ==  
Ce tutoriel vous explique comment exploiter comment commander des LEDs (DELs) en utilisant un [http://mchobby.be/PrestaShop/product.php?id_product=160 PI-Cobbler] et Python.
+
Ce tutoriel vous explique comment exploiter comment commander des LEDs (DELs) en utilisant un {{link-product-picobblerplus}} ou {{link-product-picobbler}} et Python.<br />
Assurez-vous d'avoir [http://mchobby.be/wiki/index.php?title=RaspberryPi-Accueil#Pr.C3.A9paration_pour_Python mis votre environnement Python à jour].
+
Assurez-vous d'avoir [[RaspberryPi-Accueil#Pr.C3.A9paration_pour_Python|mis votre environnement Python à jour]].
 +
 
 +
=== Pi-Cobbler ou Pi-Cobbler-Plus? ===
 +
 
 +
{{picobbler-compatibility}}
    
== PI Cobbler & resistances ==
 
== PI Cobbler & resistances ==
Ligne 46 : Ligne 50 :  
On fait ensuite le copier/coller du code  
 
On fait ensuite le copier/coller du code  
 
  <nowiki>#!/usr/bin/env python
 
  <nowiki>#!/usr/bin/env python
 +
# -*- coding: latin-1 -*-
    
import RPi.GPIO as GPIO, time
 
import RPi.GPIO as GPIO, time
Ligne 74 : Ligne 79 :  
                 GPIO.output(GREEN_LED, False)
 
                 GPIO.output(GREEN_LED, False)
 
                 GPIO.output(RED_LED, True)
 
                 GPIO.output(RED_LED, True)
 +
                STATE = RED_LED
    
         time.sleep(LED_PAUSE)</nowiki>
 
         time.sleep(LED_PAUSE)</nowiki>
Ligne 92 : Ligne 98 :  
  <nowiki>chmod +x raspi-blink.py</nowiki>
 
  <nowiki>chmod +x raspi-blink.py</nowiki>
   −
=== Exécuter notre programme ===
+
== Exécuter notre programme ==
 
  <nowiki>sudo ./raspi-blink.py</nowiki>
 
  <nowiki>sudo ./raspi-blink.py</nowiki>
 +
 +
== Arrêter votre programme ==
 +
Un simple Ctrl + C fera l'affaire
 +
 +
== Exemple en image ==
 +
{{#Widget:Iframe
 +
|url=https://www.youtube.com/embed/o6QtrS1o0QY
 +
|width=420
 +
|height=315
 +
|border=0
 +
}}
    
== Ou Acheter ==
 
== Ou Acheter ==
Le [http://mchobby.be/PrestaShop/category.php?id_category=30 Pi-Cobbler est disponible de stock chez MCHobby].
+
Les produits suivants sont disponibles chez MCHobby:
 +
* {{link-product-picobblerplus}}
 +
* {{link-product-pi3}}
 +
* {{link-product-pi2}}
 +
* {{link-product-piplus}}
 +
* {{link-product-picobbler}}
 +
* {{link-product-pi}}
    
{{MCH-Accord}}
 
{{MCH-Accord}}
    
{{ADF-Accord}}
 
{{ADF-Accord}}
29 917

modifications

Menu de navigation