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.
ADJDColourSensor Class Reference
Includes. More...
#include <ADJDColourSensor.h>
Public Member Functions | |
| ADJDColourSensor (PinName sda, PinName scl, PinName LED) | |
| float | read () |
| Read the colour sensor channels. | |
| int | readOffset () |
| Read the offsets from the device and into the corresponding members. | |
| void | setCapacitors (int redCap, int greenCap, int blueCap, int clearCap) |
| Set the number of capacitors for each channel of the ADC. | |
| void | setIntegrationTimeSlot (int redInt, int greenInt, int blueInt, int ClearInt) |
| Set the integration time slot for each of the ADCs. | |
Detailed Description
Includes.
A class to interface with an Avago ADJD-S371-QR999. The class allows you to read the light levels setected by the sensor for each colour and to set the gain settings.
Definition at line 42 of file ADJDColourSensor.h.
Constructor & Destructor Documentation
| ADJDColourSensor | ( | PinName | sda, |
| PinName | scl, | ||
| PinName | LED | ||
| ) |
LICENSE
Copyright (c) 2010 ARM Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
DESCRIPTION
Definition at line 31 of file ADJDColourSensor.cpp.
Member Function Documentation
| float read | ( | ) |
Read the colour sensor channels.
The red, green and blue values are
- Returns:
- The clear result, ie the overall brightness
Definition at line 113 of file ADJDColourSensor.cpp.
| int readOffset | ( | ) |
Read the offsets from the device and into the corresponding members.
- Returns:
- The value of the clear offset
Definition at line 183 of file ADJDColourSensor.cpp.
| void setCapacitors | ( | int | redCap, |
| int | greenCap, | ||
| int | blueCap, | ||
| int | clearCap | ||
| ) |
Set the number of capacitors for each channel of the ADC.
The values of the parameters must be between 0x00 and 0x0F
- Parameters:
-
redCap The number of capacitors for the red channel
Definition at line 51 of file ADJDColourSensor.cpp.
| void setIntegrationTimeSlot | ( | int | redInt, |
| int | greenInt, | ||
| int | blueInt, | ||
| int | ClearInt | ||
| ) |
Set the integration time slot for each of the ADCs.
All the values are as a 12 bit number
- Parameters:
-
redInt The integration time slot for the red channel greenInt The integration time slot for the green channel blueInt The integration time slot for the blue channel clearInt The integration time slot for the clear channel
Definition at line 74 of file ADJDColourSensor.cpp.
Generated on Thu Jul 14 2022 03:35:15 by
1.7.2