Skip to content

CubigelExample.ino

Arnd edited this page Jul 15, 2017 · 1 revision

Arduino sketch to demonstrate getting compressor data from the Cubigel compressor. The library collects readings in the background asynchronously while the main program is left free to do other processing. Use is made of interrupts to make this possible.

Compatibility

General

The library makes use of interrupts to retrieve readings from the Cubigel compressor asynchronously. No specific pins are used since the interrupt used is timer 0 (which is used by the millis() function).

Serial Ports

The Cubigel compressor outputs TTL-Level serial data. Since most Atmel processors have only one hardware serial UART the library makes use of the SoftwareSerial library to free up the standard serial port. The library allows 1 or 2 compressors to be monitored at the same time using any legal combination of hardware and serial ports. Since the SoftwareSerial library only checks for pin change interrupts on one port at time, if two devices are monitored then only one of them may use a SoftwareSerial port.

Function

The main loop of the program retrieves the collected measurement data every 60 seconds and displays it to the serial port.

Clone this wiki locally