Reference - Arduino Library

Copy the Hybrid Object library into your Arduino Library Folder. In your Arduino code instantiate the Hybrid Objects library as followed:

#include <HybridObject.h>
HybridObject obj;

.developer()

If called, the developer() function allows you to access all developer functionality. It allows you to move and scale user interfaces within the Reality Editor and it gives you access to the Developer Web-Page. Only call developer in the Arduino setup function.

Example:
void setup() {
obj.developer();
}

.add([Hybrid Object], [IO Point])

With the .add() function you can add new IO Points to your Hybrid Object. IO Points can be input, output or both. The direction is not relevant. The added IO Points will be represented in the Reality Editor.

Example:
void setup() {
obj.developer();
obj.add("object", "led");
obj.add("object", "sensor");
}

.read([Hybrid Object], [IO Point (String)])

Within the Arduino loop() function you can use .read to read data from an IO Point. All values are floating point in the range between 0 and 1.

Example:
void setup() {
obj.developer();
obj.add("myObject", "led");
}
void loop() {
int input = obj.read("myObject", "led");
}

 .write([Hybrid Object], [IO Point], [Value 0 ~ 1])

Within the Arduino loop() function you can use write to an IO Point. All values are floating point in the range between 0 and 1.

Example:
void setup() {
obj.developer();
obj.add("myObject", "led");
}

void loop() {
int output = 123;
obj.write("myObject", "sensor", output);
}

.map([Value], [Value Min], [Value Max])

Since all data is floating point between 0 and 1, the map function scales your data in to this scale.
For example if you have a range between 0 and 100 and your value is 50 map() will return 0.5.

Example:
void setup() {
}

void loop() {
int input = 123;
float output = obj.map(input, 0,200);
}