Changes between Version 60 and Version 61 of WikiStart
- Timestamp:
- 2013-09-24 09:27:21 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiStart
v60 v61 45 45 All 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. 46 46 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]]). 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]]). But here follows the basic usage in your Arduino sketch: 48 48 49 49 {{{ 50 50 #!div style="font-size: 80%" 51 Code highlighting:52 51 {{{#!cpp 53 52 #include <SPI.h> … … 56 55 #include <Vera.h> 57 56 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. 58 RF24 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. 62 Vera sensors(<radioId>, &radio); 63 64 void 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 60 76 61 77 }}}