Capturando temperatura utilizando Sentilla Perk

Sentilla Perk capturando datos en mi sala Al fin tuve algo de tiempo para jugar con Sentilla Perk. Comencé escribiendo un hola mundo, el cual consiste en capturar temperatura con cada sensor para luego recolectar los resultados en mi laptop la cual corre el "gateway" que habla con los sensores: /**      * Get the temperature reading      * @throws InterruptedException      */     public static void motemain() throws InterruptedException {         Leds leds = LedsDriver.create();         long id = Mac64Address.getLocalAddress().longValue();                 Sensor <Temperature>tempSensor = SensorDriver.create("temp", Temperature.class);         Sender sender = SenderDriver.create("local");         short count = 0;         TempMessage datamsg = new TempMessage();         datamsg.moteId = id;         while(true) {             count++;             leds.toggle(count); // Play with the leds             datamsg.count = count;             datamsg.temperature = tempSensor.read(); // Read the temperature             sender.send(datamsg);                         Thread.sleep(WAIT_TIME);         }     } Es interesante programar usando Java para el dispositivo; El API es bien simple y por supuesto con limitaciones dado lo pequeño del entorno. Todo en Java, y el mecanismo de comunicación completamente encapsulado, solamente hay que implementar la interfaz "Serializable". Si quieren ver vídeos y más código entonces sigue el enlace.

You have already tagged this post. Your tags:

Valid XHTML 1.0 Strict