COSA
An Object-Oriented Platform for Arduino Programming
Sensors

Button

Debounded Button; Sampled input pin (with internal pullup resistor). Uses a watchdog timeout event (64 ms) for sampling and on change calls an event action. Subclass Button and implement the virtual on_change() method.

Keypad

Handling of keypad using resistor net and analog reading. Periodically samples the analog pin and maps to key code. Callback on_key_down/up() are called when a key down/up is detected.

Encoder

State machine based Rotary Encoder handler. Uses interrupt pins and pushes an Event::CHANGE_TYPE on change with direction. Subclass Rotary::Encoder and implement the virtual on_event() method. Support for Dials both normal and accelerated.

Touch

Touch Capacitive Sensor using periodic discharging to detect a sensor touch.

DHT11

DHT11 Humidity & Temperature Sensor device driver. Subclass and implement the event handler, on_event(), to allow periodic read of device (OutputPin/InputPin).

HC-SR04

Device driver for Ultrasonic range module HC-SR04. Subclass and implement the change event handler, on_change(). Attach to watchdog timeout queue to perform periodic read and check of change (InputPin).

DS18B20

Driver for the DS18B20 Programmable Resolution 1-Write Digital Thermometer (OWI).

ADXL345

Driver for the ADXL345 Digital Accelerometer (TWI).

HMC5883L

Driver for the HMC5883L 3-Axis Digital Compass (TWI).

PCF8591

Driver for the PCF8591 2-Wire 8-bit A/D and D/A converter (TWI).

BMP085

Driver for the BMP085 Digital Pressure sensor (TWI).

L3G4200D

Driver for the L3G4200D Digital Gyroscope (TWI).

MPU6050

Driver for MPU6050 Motion Processing Unit; Digital thermometer, accelerometer and gyroscope (TWI).