Modifications

Sauter à la navigation Sauter à la recherche
234 octets ajoutés ,  17 novembre 2018 à 22:49
Ligne 94 : Ligne 94 :  
Le script {{fname|stress.py}} permet de stresser le contrôleur en modifiant continuellement les couleurs.
 
Le script {{fname|stress.py}} permet de stresser le contrôleur en modifiant continuellement les couleurs.
   −
== Exemple avec MOD-RGB ==
+
== Fonctionnalité du MOD-RGB ==
   −
<syntaxhighlight lang="python">from machine import I2C, Pin
+
<syntaxhighlight lang="python"># Utilisation du MOD-RGB d'Olimex avec un ESP8266 sous MicroPython
 +
#
 +
# Shop: [UEXT RGB board (MOD-RGB)](http://shop.mchobby.be/product.php?id_product=1410)
 +
# Wiki: https://wiki.mchobby.be/index.php?title=MICROPYTHON-MOD-IO2
 +
 
 +
from machine import I2C, Pin
 
from time import sleep_ms
 
from time import sleep_ms
 
from modrgb import MODRGB
 
from modrgb import MODRGB
    
i2c = I2C( sda=Pin(2), scl=Pin(4) )
 
i2c = I2C( sda=Pin(2), scl=Pin(4) )
rgb = MODRGB( i2c ) # default address=0x20
+
rgb = MODRGB( i2c ) # adresse par defaut=0x20
    
# Un code couleur est composé à l'aide  
 
# Un code couleur est composé à l'aide  
29 879

modifications

Menu de navigation