Outils pour utilisateurs

Outils du site


smartcitizen

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
smartcitizen [2020/11/12 18:52] – [Thread in Kivy] sergesmartcitizen [2020/12/01 17:43] (Version actuelle) – ↷ Liens modifiés en raison d'un déplacement. serge
Ligne 10: Ligne 10:
 **Voir [[smartcitizen_hardware_software|la page dédiée aux recherches et expérimentations autour du kit SmartCitizen coté logiciel et matériel]]** : extraction de données, envoi par client mqtt, connexion au réseau Lora, ... **Voir [[smartcitizen_hardware_software|la page dédiée aux recherches et expérimentations autour du kit SmartCitizen coté logiciel et matériel]]** : extraction de données, envoi par client mqtt, connexion au réseau Lora, ...
  
-{{ ::smartcitizen-kitv2-47950912168_fcf8fa398c_h.jpg|}}+{{ media_12:smartcitizen-kitv2-47950912168_fcf8fa398c_h.jpg|}}
  
  
Ligne 25: Ligne 25:
 <WRAP group> <WRAP group>
 <WRAP third column> <WRAP third column>
-{{::smartcitizen_1.png?300|}}+{{media_12:smartcitizen_1.png?300|}}
 </WRAP> </WRAP>
 <WRAP third column> <WRAP third column>
-{{::smartcitizen_2.png?300|}}+{{media_12:smartcitizen_2.png?300|}}
 </WRAP> </WRAP>
  
 <WRAP third column> <WRAP third column>
-{{::smartcitizen_3.png?300|}}+{{media_12:smartcitizen_3.png?300|}}
 </WRAP> </WRAP>
 </WRAP> </WRAP>
  
  
-{{ :smartcitizen.apk |}}+{{ media_12:smartcitizen.apk |}}
 ====Ressources==== ====Ressources====
   * **[[https://smartcitizen.me/kits/9525|Nos capteurs]]** La page web de nos capteurs   * **[[https://smartcitizen.me/kits/9525|Nos capteurs]]** La page web de nos capteurs
Ligne 45: Ligne 45:
   * **[[https://forum.smartcitizen.me/t/is-it-possible-to-get-the-data-out-of-the-sensor-directly/1343/5|Comment récupérer directement les données sans passer par le site web]]**   * **[[https://forum.smartcitizen.me/t/is-it-possible-to-get-the-data-out-of-the-sensor-directly/1343/5|Comment récupérer directement les données sans passer par le site web]]**
 ===apk=== ===apk===
-**{{ ::smartcitizen.apk |}}** du 16/02/2020+**{{ media_12:smartcitizen.apk |}}** du 16/02/2020
  
 ====Les choses non réussies==== ====Les choses non réussies====
Ligne 57: Ligne 57:
 Une solution plus élégante est utilisée dans **[[https://github.com/sergeLabo/accelerometer/blob/main/main.py|accelerometer: main.py]]** avec Une solution plus élégante est utilisée dans **[[https://github.com/sergeLabo/accelerometer/blob/main/main.py|accelerometer: main.py]]** avec
 <code python> <code python>
 +class AccelerometerApp(App):
 +    def build(self):
 +        return Accelerometer(self)
 +        
 +class Accelerometer(BoxLayout):
 +    def __init__(self, app, **kwargs):
 +        super().__init__(**kwargs)
 +        self.app = app
 +        self.app.osc = OSC()
 +        
 +class OSC:
 +    def __init__(self):
 +        self.histo = []
 +        self.server = OSCThreadServer()
 +        self.server.bind(b'/histo', self.on_histo)
 +        
 +    def on_histo(self, *args):
 +        self.histo = ....
 +        
 class Screen2: class Screen2:
-  self.app = App.get_running_app() # dans __init__() +    def __init__(self): 
-  # et appel de l'attribut histo de OSC avec +        self.app = App.get_running_app() # dans __init__() 
-  self.app.osc.histo +        # et appel de l'attribut histo de OSC avec 
 +        self.app.osc.histo 
 +        Clock.schedule_once(self._once, 1) 
 + 
 +    def _once(self, dt): 
 +        Clock.schedule_interval(self.update, 0.1) 
 +         
 +    def update(self, dt):  
 +        blabla = self.app.osc.histo  
 +        # blabla retrouve la valeur de histo de OSC !!!!
 </code> </code>
  
smartcitizen.txt · Dernière modification : 2020/12/01 17:43 de serge