background preloader

WeIO

Facebook Twitter

Julien Marillet
Dane Vwanza
Edouard Delouche

Capteur de luminosité. Sensor Luminosity Test #Succes. Test capteur luminosité sucess. Test luminosity sensor. Test du capteur d'humidité. Examples. Boilerplate HTML & JS boilerplate This is html boilerplate for WeIO.

Examples

WeIO includes dependencies : jQuery, sockJS and weioApi. <! DOCTYPE html><html lang="en"><script data-main="weioLibs/weio" src="weioLibs/require.js"></script><head ><title>My first Web app</title></head><body><p>Hello world! OnWeioReady() This function is called when the DOM is fully loaded and websocket to WeIO is fully opened.

Function onWeioReady() { console.log("DOM is loaded, websocket is opened"); } Digital I/O digitalWrite(pin, value) Sets voltage to +3.3V or Ground on corresponding pin. In index.html add one button in the body section <button type="button" id="myButton">ON</button> In Javascript we can bind one event to this button and then turn one pin HIGH or LOW. Var buttonState = false; function onWeioReady() { $( "#myButton" ).click(function() { if (buttonState) { digitalWrite(20,HIGH); $( "#myButton" ).html("ON"); } else { digitalWrite(20,LOW); $( "#myButton" ).html("OFF"); } buttonState = !

Example tutorial Arduino + DHT11. Mesure de la température et l'humidité de l'air avec un capteur DHT11 et une carte Arduino.

Example tutorial Arduino + DHT11

Matériel 1 capteur DHT111 carte Arduino Uno R31 breadboard et 3 fils de câblage1 résistance ~ 5kPrincipeOn peut mesurer la température et l'humidité de l'air avec un capteur DHT11Ce capteur miniature (12 x 16 x 6 mm, 3 g) comporte 4 broches en ligne.Il comporte deux capteurs intégrés :1 Capteur résistif d'humidité1 Capteur NTC de température (thermistor) Sa sortie est numérique (8 bits), en mode single-wire (une seule broche), et ne nécessite donc pas d'entrée analogique.Le capteur est calibré en usine, les paramètres sont stockés dans sa mémoire.Il est alimenté en courant continu de 3.5-5V DC (ajouter une capa de 100nF pour filtrer l'alimentation, entre Vcc en GND).

Précision de mesures Humidité de l'air (HR) de 20-90% (0-50°C), précision typique 4 % (maximum ± 5%)Température de l'air, précision typique ± 1°C (maximum ±2°C)Consommation : 0.5 mA en nominal / 2.5 mA maximum. Test double LED.

Une petite explication sur ce test double led ? – tatianagrange

WeiO Blink LED. Photoshop expert.

Setting the Party nigth button

WeIO Documentation. Program Structure WeIO program structure is following: main.py - this is your main Python program (not mandatory if you are making HTML-only program)index.html - this is your HTML/JS client-side (executed in user browser) program and/or UI (if you have one) main.py This is your main program, writtent entirely in Python.

WeIO Documentation

If you want to write HTML-only program (which is not standalone, but can be executed only when user opens browser and access WeIO), then you do not need this file. However, if you want to make standalone programs that are independent of user and execute whenever you turn on your WeIO, then this file is mandatory. Some caracteristics of WeIO Python support are following: - Entry point of every project is it’s main.py, so it must exist - Full standard Python is supported - you can import and use every Python module (using pip or easy_install) - WeIO programs are multi-tasking. Import WeIO Python API This is achieved by adding from weioLib.weio import * to your program. index.html. Example set-up. Actuators tone_PY & JS This example shows how to play tones on a Piezo Speaker using PWM signals.

Example set-up

A Piezo is nothing but an electronic device that can both be used to play tones and to detect tones. circuit In our example we are plugging the Piezo on the pin number 23, that supports the functionality of writing a PWM signal to it, and not just a plain HIGH or LOW value. Piezos have polarity, commercial devices are usually having a red and a black wires indicating how to plug it to the board. Code: tone_PY In the program below, the only thing that you do will in the setup() function is to attach myTone function to main process with the command: attach.process(myTone) Next, in myTone function, you need to initialisse freq variable that will be the frequency of first played tone : freq = 16 Then create an infinite loop for play tones every 100 milliseconds with this commands : Technologie weIO descriptif. DHT11 Capteur d'humidité et de température.