An Arduino library for the Pimoroni RGBW trackball breakout, as shown below.
These trackballs communicate over I2C and optionally provide an interrupt you can use to trigger events. This library does not yet support interrupts and callbacks but may in the future.
Initialises and starts the breakout. By default assumes I2C address 0x0A, which is the default I2C address for the breakout and the I2C port 'Wire'. If you supply an argument you can set it to a different address and optionally I2C interface.
Returns true if the trackball breakout is detected as connected.
Reads the current state of the trackball and returns true if it has changed since the last read.
How far left the trackball has moved. Note this resets on reading, it does not constantly increase.
How far right the trackball has moved. Note this resets on reading, it does not constantly increase.
How far up the trackball has moved. Note this resets on reading, it does not constantly increase.
How far down the trackball has moved. Note this resets on reading, it does not constantly increase.
Returns true if the trackball is clicked. Note this resets on reading and does not stay true while the ball is held down.
Returns true if the trackball is released. Note this resets on reading and does not stay true while the ball is not held down.
Sets all the LEDs in the trackball in one function.
Sets the red LED brightness.
Sets the green LED brightness.
Sets the blue LED brightness.
Sets the white LED brightness.