Voici la question qui me guide dans mes recherches...

L’appât du gain manifesté par les entreprises supranationales et certains groupes oligarchiques, de même que le contrôle des ressources naturelles par ceux-ci, dirigent l’humanité vers un nouvel ordre mondial de type féodal, voir même sa perte. Confronté à cette situation, l’être humain est invité à refuser d’accepter d’emblée une pseudo-vérité véhiculée par des médias peut-être à la solde de ces entreprises et groupes. Au contraire, il est invité à s’engager dans un processus de discernement et conscientisation afin de créer sa propre vérité par la confrontation de sa réalité nécessairement subjective à des données objectives, telles que révélées par la science, par exemple.

The penalty that good men pay for not being interested in politics is to be governed by men worse than themselves. - Plato

jeudi 3 mars 2016

The Zerynth Framework: programming IoT with Python

Here's some quick notes on what I discovered today on

The Zerynth Framework: programming IoT with Python

Good starting point well written on open-electronics.org

Here we learn of a new firmware that can be loaded on those microcontroller:

Here's some links for those microcontrollers, mostly based on ARM 32 bit.

Here's an example code for blinking 3 leds independently showing the power of Zerynth  multi-treading 
# Initialize the digital pins where the LEDs are connected as output
pinMode(D2,OUTPUT)
pinMode(D3,OUTPUT)
pinMode(D4,OUTPUT)
# Define the ‘blink’ function to be used by the threads
# delayON and delayOFF are optional parameters, used as default if not specified when you call the function
def blink(pin,timeON=100,timeOFF=100):
while True:
digitalWrite(pin,HIGH) # turn the LED ON by making the voltage HIGH
sleep(timeON) # wait for timeON
digitalWrite(pin,LOW) # turn the LED OFF by making the voltage LOW
sleep(timeOFF) # wait for timeOFF
# Create three threads that execute instances of the ‘blink’ function.
thread(blink,D2) # D2 is ON for 100 ms and OFF for 100 ms, the default values of delayON an delayOFF
thread(blink,D3,200) # D3 is ON for 200 ms and OFF for 100 ms, the default value of delayOFF
thread(blink,D4,500,200) # D4 is ON for 500 ms and OFF for 200 ms

To get you started with testing and development, they created the Zerynth shield

Which consist of many sensors and actuators 
This can be found here for around 56$

Here's an example of using this shield:
############################################################################################################
# TOI Shield basics
#
# Created by VIPER Team 2015 CC
# Authors: L. Rizzello, G. Baldi, D. Mazzei
############################################################################################################
import streams
import adc
from drivers.toishield import toishield
streams.serial()
# toishield defines pin names in a board indipendent manner
# let’s use them to read raw sensors values
while True:
print(“ Microphone:”,adc.read(toishield.microphone_pin))
print(“ Light:”,adc.read(toishield.light_pin))
print(“Temperature:”,adc.read(toishield.temperature_pin))
print(“ Touch:”,digitalRead(toishield.touch_pin))
# aux pins are also accessible!
print(“ AUX1:”,adc.read(toishield.aux1.ADC))
print(“-”*40)
sleep(500)
# this scripts runs on every supported board, without a single change...cool isn’t it? <img src="http://www.open-electronics.org/wp-includes/images/smilies/simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;">

Looks interesting, right!... now if you want to learn Python... there's a lot of resources:

Aucun commentaire: