| EVShield v1.3 EVShield Library Reference by mindsensors.com

Public Member Functions | List of all members
EVs_LightSensorArray Class Reference

This class interfaces with LightSensorArray attached to EVShield. More...

`#include <EVs_LightSensorArray.h>`

Inheritance diagram for EVs_LightSensorArray:

## Public Member Functions
| EVs_LightSensorArray (uint8_t i2c_address=0x02)
uint8_t | issueCommand (char command)
bool | calibrateWhite ()
bool | calibrateBlack ()
bool | sleep ()
bool | wakeUp ()
bool | configureUS ()
bool | configureEurope ()
bool | configureUniversal ()
uint8_t * | getCalibrated ()
uint8_t * | getUncalibrated ()
uint8_t * | getWhiteLimit ()
uint8_t * | getBlackLimit ()
uint8_t * | getWhiteCalibration ()
uint8_t * | getBlackCalibration ()
Public Member Functions inherited from EVShieldI2C
| EVShieldI2C (uint8_t i2c_address)
void | init (void *shield, SH_BankPort bp)
uint8_t | readByte (uint8_t location)
uint16_t | readInteger (uint8_t location)
uint32_t | readLong (uint8_t location)
uint8_t * | readRegisters (uint8_t start_register, uint8_t bytes, uint8_t *buf)
char * | readString (uint8_t location, uint8_t bytes_to_read, uint8_t *buffer=0, uint8_t buffer_length=0)
bool | writeRegisters (uint8_t start_register, uint8_t bytes_to_write, uint8_t *buffer=0)
bool | writeByte (uint8_t location, uint8_t data)
bool | writeInteger (uint8_t location, uint16_t data)
bool | writeLong (uint8_t location, uint32_t data)
char * | getFirmwareVersion ()
char * | getVendorID ()
char * | getDeviceID ()
char * | getFeatureSet ()
uint8_t | getErrorCode ()
bool | checkAddress ()
bool | setAddress (uint8_t address)
Public Member Functions inherited from BaseI2CDevice
| BaseI2CDevice (uint8_t i2c_address)
void | initProtocol ()
uint8_t * | readRegisters (uint8_t start_register, uint8_t bytes_to_read, uint8_t *buffer=0, uint8_t buffer_length=0, bool clear_buffer=false)
uint8_t | readByte (uint8_t location)
int16_t | readInteger (uint8_t location)
uint32_t | readLong (uint8_t location)
char * | readString (uint8_t location, uint8_t bytes_to_read, uint8_t *buffer=0, uint8_t buffer_length=0)
bool | writeRegisters (uint8_t start_register, uint8_t bytes_to_write, uint8_t *buffer=0)
bool | writeByte (uint8_t location, uint8_t data)
bool | writeInteger (uint8_t location, uint16_t data)
bool | writeLong (uint8_t location, uint32_t data)
bool | checkAddress ()
bool | setAddress (uint8_t i2c_address)
uint8_t | getAddress ()
uint8_t | getWriteErrorCode ()
char * | getFirmwareVersion ()
char * | getVendorID ()
char * | getDeviceID ()
char * | getFeatureSet ()
Public Member Functions inherited from SoftI2cMaster
uint8_t | start (uint8_t addressRW)
void | stop (void)
uint8_t | restart (uint8_t addressRW)
uint8_t | write (uint8_t b)
uint8_t | read (uint8_t last)
| SoftI2cMaster (uint8_t devAddr)
void | initProtocol (uint8_t sclPin=(uint8_t) NULL, uint8_t sdaPin=(uint8_t) NULL)
uint8_t * | readRegisters (uint8_t startRegister, uint8_t bytes, uint8_t *buf=NULL)
bool | writeRegistersWithLocation (int bytes, uint8_t *buf)
bool | writeRegisters (uint8_t location, uint8_t bytes_to_write, uint8_t *buffer=0)
bool | writeByte (uint8_t location, uint8_t data)
bool | writeInteger (uint8_t location, uint16_t data)
bool | writeLong (uint8_t location, uint32_t data)
char * | readString (uint8_t startRegister, uint8_t bytes, uint8_t *buf=NULL, uint8_t len=0)
uint8_t | readByte (uint8_t location)
int16_t | readInteger (uint8_t location)
uint32_t | readLong (uint8_t location)
char * | getFirmwareVersion ()
char * | getVendorID ()
char * | getDeviceID ()
uint8_t | getWriteErrorCode ()
bool | checkAddress ()
bool | setAddress (uint8_t address)

## Additional Inherited Members
Public Attributes inherited from EVShieldI2C
void * | mp_shield
uint8_t * | _i2c_buffer
uint8_t | m_protocol
Public Attributes inherited from SoftI2cMaster
uint8_t * | _so_buffer
Static Public Attributes inherited from BaseI2CDevice
static uint8_t * | _buffer = 0
static bool | b_initialized = false
Protected Member Functions inherited from BaseI2CDevice
void | setWriteErrorCode (uint8_t code)

## Detailed Description

This class interfaces with LightSensorArray attached to EVShield.

## Constructor & Destructor Documentation

## § EVs_LightSensorArray()

EVs_LightSensorArray::EVs_LightSensorArray | ( | uint8_t | i2c_address = `0x02` | ) |

Class constructor for LightSensorArray; custom i2c address is an optional parameter

## Member Function Documentation

## § calibrateBlack()

bool EVs_LightSensorArray::calibrateBlack | ( |  | ) |

Calibrate the current input to the device as black

## § calibrateWhite()

bool EVs_LightSensorArray::calibrateWhite | ( |  | ) |

Calibrate the current input to the device as white

## § configureEurope()

bool EVs_LightSensorArray::configureEurope | ( |  | ) |

Configure sensor for European region (and regions with 50 Hz electrical frequency).

## § configureUniversal()

bool EVs_LightSensorArray::configureUniversal | ( |  | ) |

Configure sensor for universal frequency (in this mode the sensor adjusts for any frequency, this is also the default mode).

## § configureUS()

bool EVs_LightSensorArray::configureUS | ( |  | ) |

Configure Sensor for US region (and regions with 60 Hz electrical frequency).

## § getBlackCalibration()

uint8_t * EVs_LightSensorArray::getBlackCalibration | ( |  | ) |

Calibrate Black

Returns
  the current calibration of black

## § getBlackLimit()

uint8_t * EVs_LightSensorArray::getBlackLimit | ( |  | ) |

Get the limit at which black changes to white

## § getCalibrated()

uint8_t * EVs_LightSensorArray::getCalibrated | ( |  | ) |

Get the raw readings from the sensor that is calibrated based on black and white calibration values

Returns
  array of 8 bytes of the sensors' calibrated values.

## § getUncalibrated()

uint8_t * EVs_LightSensorArray::getUncalibrated | ( |  | ) |

Get the raw uncalibrated sensor values straight from the sensor

Returns
  array of 8 bytes of the sensors' uncalibrated values.

## § getWhiteCalibration()

uint8_t * EVs_LightSensorArray::getWhiteCalibration | ( |  | ) |

Calibrate White

Returns
  Current calibration of white

## § getWhiteLimit()

uint8_t * EVs_LightSensorArray::getWhiteLimit | ( |  | ) |

Get the limit at which white changes to black

## § issueCommand()

uint8_t EVs_LightSensorArray::issueCommand | ( | char | command | ) |

Write a command byte to the command register of the device

## § sleep()

bool EVs_LightSensorArray::sleep | ( |  | ) |

Turn off the LEDs on the device and put it in the sleep state

## § wakeUp()

bool EVs_LightSensorArray::wakeUp | ( |  | ) |

Turn on the LEDs and wake up the device

The documentation for this class was generated from the following files:

- C:/Program Files (x86)/Arduino-1.6.12/libraries/EVShield/EVs_LightSensorArray.h
- C:/Program Files (x86)/Arduino-1.6.12/libraries/EVShield/EVs_LightSensorArray.cpp