Changes between Version 60 and Version 61 of WikiStart


Ignore:
Timestamp:
2013-09-24 09:27:21 (11 years ago)
Author:
hek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v60 v61  
    4545All the components developed and compiled here are Open Source. The Vera plugin was inspired by the excellent rfxtrx plugin. I've also written a Arduino library handling all encoding and communication between Arduino sensors and ArduinoGateway. The Vera plugin part automatically creates newly found sensors in Vera. 
    4646 
    47 It should be pretty simple to use the library (some more documentation in [[http://code.mios.com/trac/mios_arduino-sensor/browser/trunk/Arduino/libraries/Vera/Vera.h|vera.h]]).  
     47It should be pretty simple to use the library (some more documentation in [[http://code.mios.com/trac/mios_arduino-sensor/browser/trunk/Arduino/libraries/Vera/Vera.h|vera.h]]). But here follows the basic usage in your Arduino sketch: 
    4848  
    4949{{{ 
    5050#!div style="font-size: 80%" 
    51 Code highlighting: 
    5251  {{{#!cpp 
    5352#include <SPI.h>   
     
    5655#include <Vera.h>   
    5756 
    58 RF24 radio(9,10); // Create radio library instance using pin 9,10 
    59 Vera sensors(<radioId>, &radio); // Create vera library with radio id <radioId>. This should be a value between 1-255. 
     57// Create RF24 library instance using pin 9,10 which is what I've described how to hook up the radio module in this wiki. 
     58RF24 radio(9,10);  
     59 
     60// Create a Vera library instance with radio id <radioId>. This should be a value between 1-255.  
     61// You cannot share radioId between two arduino sensors. 
     62Vera sensors(<radioId>, &radio);  
     63 
     64void setup()   
     65{ 
     66  // Initialize and start up vera library (this also initializes the radio stuff) 
     67  vera.begin(); 
     68 
     69  // Register sensor(s) to Vera (they will be created as child devices when found). 
     70  // childId - Each Arduino can have up to 128 child sensors. 0-127. 
     71  // deviceType - Which (vera) device type to use for this sensor. See [[http://code.mios.com/trac/mios_arduino-sensor/browser/trunk/Arduino/libraries/Vera/Vera.h|vera.h]]). 
     72  vera.sendSensorPresentation(<childId>, <deviceType>);  
     73} 
     74 
     75 
    6076 
    6177  }}}