Modifications
Sauter à la navigation
Sauter à la recherche
← Modification précédente
Modification suivante →
Mydin-advanced-usage
(voir la source)
Version du 29 avril 2025 à 17:13
277 octets ajoutés
,
29 avril 2025 à 17:13
→Using setup()
Ligne 90 :
Ligne 90 :
def setup( din ):
def setup( din ):
−
# Add a new attribute to "din" instance
+
# Add a new attribute
"sensor"
to "din" instance
din.sensor = BME280( i2c=din.i2c, address=BMP280_I2CADDR )
din.sensor = BME280( i2c=din.i2c, address=BMP280_I2CADDR )
Ligne 102 :
Ligne 102 :
</syntaxhighlight>
</syntaxhighlight>
−
Notice
the definition of
the {{fname|def setup():}} function and its
referencing
in {{fname|din.setup( setup='''setup''', loop=loop )}} call.
+
Remarks:
+
*
Notice the {{fname|def setup():}} function
definition
and its
reference
in {{fname|
1=
din.setup( setup='''setup''', loop=loop )}} call
.
+
* The instance of BME280 is stored under the '''din.sensor''' attribute.
+
* The {{fname|def setup():}} function '''IS NOT AN ASYNC''' function.
+
* The {{fname|async def loop( din )}} ''userloop'' can retreive the BME280 instance from the '''din.sensor''' attribute
.
== Activating watchdog ==
== Activating watchdog ==
== Add Scheduler Task ==
== Add Scheduler Task ==
Admin
Bureaucrates
,
Administrateurs
32 908
modifications
Menu de navigation
Outils personnels
Se connecter
Espaces de noms
Page
Discussion
Variantes
Affichages
Lire
Voir le texte source
Voir l’historique
Plus
Rechercher
Navigation
ARDUINO
RASPBERRY-PI
[:: PI Hacking ::]
Particle.IO
Micro Python
Imprimante 3D
Actualités
Modifications récentes
Page au hasard
Aide
Outils
Pages spéciales
Version imprimable