...
In order for actions on the Application interface like (Click on the Led) and it to turn on the Led on the Arduino, we need the name of the Widget to be the same name that we defined in the arduino code using: ODev.addDevice("Led", 13, Device::DIGITAL); // LINE 11
Now to send information from the Arduino to the Application, one way is to define a sensor, using: ODev.addSensor("Name", ....)
.
Taking line 13 as an example. Note that in this example we are passing a function: readTemperature
, it will be responsible for the reading code. (That way any sensor can be read).
Yet in line 13, we define the interval of 200ms
that the sensor should be read.
...