Header for MeColorSensor.cpp module.
More...
#include <stdint.h>
#include <stdbool.h>
#include <Arduino.h>
#include "MeConfig.h"
#include "MePort.h"
Go to the source code of this file.
|
|
#define | I2C_ERROR (-1) |
| |
|
#define | COLORSENSOR_DEFAULT_ADDRESS (0x38) |
| |
|
#define | SYSTEM_CONTROL (0X40) |
| |
|
#define | MODE_CONTROL1 (0X41) |
| |
|
#define | MODE_CONTROL2 (0X42) |
| |
|
#define | MODE_CONTROL3 (0X44) |
| |
|
#define | RED_DATA_LSBs (0X50) |
| |
|
#define | RED_DATA_MSBs (0X51) |
| |
|
#define | GREEN_DATA_LSBs (0X52) |
| |
|
#define | GREEN_DATA_MSBs (0X53) |
| |
|
#define | BLUE_DATA_LSBs (0X54) |
| |
|
#define | BLUE_DATA_MSBs (0X55) |
| |
|
#define | CLEAR_DATA_LSBs (0X56) |
| |
|
#define | CLEAR_DATA_MSBs (0X57) |
| |
|
#define | DINT_DATA_LSBs (0X58) |
| |
|
#define | DINT_DATA_MSBs (0X59) |
| |
|
#define | INTERRUPT (0X60) |
| |
|
#define | PERSISTENCE (0X61) |
| |
|
#define | TH_LSBs (0X62) |
| |
|
#define | TH_MSBs (0X63) |
| |
|
#define | TL_LSBs (0X64) |
| |
|
#define | TL_MSBs (0X65) |
| |
|
#define | MANUFACTURER_ID (0X92) |
| |
|
#define | CHIP_ID (0XE0) |
| |
|
#define | SW_RESET (1 << 7) |
| |
|
#define | INT_RESET (1 << 6) |
| |
|
#define | MEASURE_160MS (0x00) |
| |
|
#define | MEASURE_320MS (0x01) |
| |
|
#define | MEASURE_640MS (0x02) |
| |
|
#define | MEASURE_1280MS (0x03) |
| |
|
#define | MEASURE_2560MS (0x04) |
| |
|
#define | MEASUREMENT_MAX (0x05) |
| |
|
| enum | COLORTYPES {
WHITE = 0
, PINKE = 1
, RED = 2
, ORANGE = 3
,
YELLOW = 4
, GREEN = 5
, CYAN = 6
, BLUE = 7
,
PURPLE = 8
, BLACK = 9
, GOLD = 10
} |
| |
Header for MeColorSensor.cpp module.
- Author
- MakeBlock
- Version
- V1.0.3
- Date
- 2017/01/17
- Copyright
- This software is Copyright (C), 2012-2016, MakeBlock. Use is subject to license
conditions. The main licensing options available are GPL V2 or Commercial:
- Open Source Licensing GPL V2
- This is the appropriate option if you want to share the source code of your
application with everyone you distribute it to, and you also want to give them
the right to share who uses it. If you wish to use this software under Open
Source Licensing, you must contribute all your source code to the open source
community in accordance with the GPL Version 2 when your application is
distributed. See http://www.gnu.org/copyleft/gpl.html
- Description
- This file is a drive for MeColorSensor module, It supports MeColorSensor V1.0 device provided by MakeBlock.
- Method List:
- void MeColorSensor::SensorInit(void)
- uint8_t MeColorSensor::ReportId(void)
- void MeColorSensor::ColorDataRead(void)
- void MeColorSensor::TurnOnLight(void)
- void MeColorSensor::TurnOffLight(void)
- uint16_t MeColorSensor::ReturnRedData(void)
- uint16_t MeColorSensor::ReturnGreenData(void)
- uint16_t MeColorSensor::ReturnBlueData(void)
- uint16_t MeColorSensor::ReturnColorData(void)
- uint8_t MeColorSensor::ColorIdentify(void)
- long MeColorSensor::ReturnColorCode(void)
- uint16_t MeColorSensor::calculateColorTemperature(void)
- uint16_t MeColorSensor::calculateLux(void)
- int8_t MeColorSensor::writeReg(int16_t reg, uint8_t data)
- int8_t MeColorSensor::readData(uint8_t start, uint8_t *buffer, uint8_t size)
- int8_t MeColorSensor::writeData(uint8_t start, const uint8_t *pData, uint8_t size)
- uint8_t MeColorSensor::Returnresult(void);
- uint8_t MeColorSensor::ReturnGrayscale(void);
- uint16_t MeColorSensor::ReturnColorhue(void);
- uint8_t MeColorSensor::MAX(uint8_t r,uint8_t g,uint8_t b);
- uint8_t MeColorSensor::MIN(uint8_t r,uint8_t g,uint8_t b);
- void MeColorSensor::TurnOffmodule(void);
- void MeColorSensor::TurnOnmodule(void);
- uint8_t MeColorSensor::ColorDataReadOnebyOne();
- History:
`<Author>` `<Time>` `<Version>` `<Descr>`
zzipeng 2017/01/17 1.0.0 complete the driver code.
zzipeng 2017/04/03 1.0.1 only detect six colors.
zzipeng 2017/04/10 1.0.2 only detect seven colors and add methods named MeColorSensor::TurnOffmodule(void),MeColorSensor::TurnOnmodule.
zzipeng 2017/04/20 1.0.3 add methods MeColorSensor::ColorDataReadOnebyOne();
Lanweiting 2017/06/23 1.0.4 Canonical the code format.