Discrete RGB colour sensor using a colour LED flashing at high speed and a monochrome LDR (light dependent resistor) for detecting the colour via ADC conversion. The library implements interrupt driven ADC conversion at high speed (370 RGB readings per second, 128 times oversampling per channelfor noise reduction). The detection can optionally run in background.

Dependents:   rgb_sensor_buffer discrete_rgb_color_sensor_example

Revision:
4:0ffadc2caaf6
Parent:
3:50e1ac3c56db
Child:
5:1fed2b68e661
--- a/rgb_sensor.cpp	Fri Jun 27 11:36:15 2014 +0000
+++ b/rgb_sensor.cpp	Fri Jun 27 12:14:36 2014 +0000
@@ -157,6 +157,8 @@
                         /* stop data aquisition */
                         if(m_done)
                             LPC_ADC->ADCR &= ~(1UL<<16);
+                        else
+                            memset(&m_adc_aggregation, 0, sizeof(m_adc_aggregation));
                 }                        
             }
         }