From ThingML

Main: ArduinoLib

Core library

Arduino standard library
Arduino timer
Digital input
Digital output
Analog input
PWM

Arduino standard library

Arduino timer

The arduino_timer file provides a soft timer witch is used by quite all devices.

Message

Digital input

There are three ways to use digital input. All of them use same messages.

Messages

Simple digital input

The digital state is send only when it is requested.

Configuration

Periodic digital input

In addition to send the result when it is requested, the digital state is send periodically every refresh_rate milliseconds.

Configuration

On change digital input

In addition to send the result when it is requested, the digital state is send at every change.

Configuration

Digital output

Enables to set a digital state on a pin.

Messages

Configuration

Analog input

Three types of analog input can be used. All of them use same messages but keep in mind that some properties can differ.

Messages

Simple analog input

The value of the analog pin is send only when it is requested.

Configuration

Periodic analog input

In addition to send the result when it is requested, the value is send periodically every refresh_rate milliseconds.

Configuration

On change analog input

In addition to send the result when it is requested, the value state is send when a change is detected. To avoid too many messages the value is checked every 20 milliseconds by default (refresh_rate). Moreover to prevent fake changes there is a value_precision property which enables to fix the threshold which determine if the value has changed. The default value is 1. Keep in mind a value of 1 imply that the analog value has to vary at least of 2 to get refreshed.

Configuration

PWM

Enables to set a PWM value between 0 and 255 on a pin.

Messages

Configuration

Retrieved from https://thingml.org/pmwiki.php?n=Main.ArduinoLib
Page last modified on September 02, 2011, at 12:12 PM