Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ISL29125_demo FinalProject Final_NSR 4180FinalProject_copy ... more
Homepage
Device documentation¶
Detailed information is available at Intersil
Calling the constructor¶
The constructor can be instantiaded in 3 ways:
Information
The first two pins (SDA and SCL) always need to be declared.
ISR mode
void RGBsensor_irq(void) // User ISR { .... } ISL29125 RGBsensor(PTE0, PTE1, PTD7, &RGBsensor_irq); // sda, scl, irq, user isr
The user ISR is called whenever the upper/lower threshold is reached and/or when a conversion cycle is finished. The threshold (Threshold
function) and end of conversion (IRQonCnvDone
function) interrupts can be enabled separately.
In this mode, PTD7 is an interrupt input.
Limitation!
Calling the Read
function at a high rate will result in a I2C failure.
Use a Ticker to call the Read
function at regular intervals. Example : ISL29125_demo
SYNC mode
ISL29125 RGBsensor(PTE0, PTE1, PTD7); // sda, scl, sync input
In this mode, PTD7 is a digital output. Initially, the sensor is idle (no conversions) and can be started by calling the Run
function.
Polling mode
ISL29125 RGBsensor(PTE0, PTE1); // sda, scl
In this mode, user defined functions are needed to poll the sensor status, read the sensor data, ....