EVShield
v1.3
EVShield Library Reference by mindsensors.com
|
This class interfaces with NXTCam attached to EVShield. More...
#include <EVs_NXTCam.h>
Public Member Functions | |
EVs_NXTCam (uint8_t i2c_address=0x02) | |
uint8_t | issueCommand (char command) |
bool | sortSize () |
bool | selectObjectMode () |
bool | writeImageRegisters () |
bool | disableTracking () |
bool | enableTracking () |
bool | getColorMap () |
bool | illuminationOn () |
bool | readImageRegisters () |
bool | selectLineMode () |
bool | pingCam () |
bool | resetCam () |
bool | sendColorMap () |
bool | illuminationOff () |
bool | sortColor () |
bool | sortNone () |
bool | camFirmware () |
int | getNumberObjects () |
void | getBlobs (int *nblobs, uint8_t *color, uint8_t *left, uint8_t *top, uint8_t *right, uint8_t *bottom) |
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) |
This class interfaces with NXTCam attached to EVShield.
EVs_NXTCam::EVs_NXTCam | ( | uint8_t | i2c_address = 0x02 | ) |
class constructor for NXTCam with optional custom i2c address parameter
bool EVs_NXTCam::camFirmware | ( | ) |
get the firmware of the NXTCam
bool EVs_NXTCam::disableTracking | ( | ) |
disable tracking for the NXTCam
bool EVs_NXTCam::enableTracking | ( | ) |
enable tracking for the NXTCam
void EVs_NXTCam::getBlobs | ( | int * | nblobs, |
uint8_t * | color, | ||
uint8_t * | left, | ||
uint8_t * | top, | ||
uint8_t * | right, | ||
uint8_t * | bottom | ||
) |
This function gets the blob information of all the blobs that NXTCam is tracking. There could be upto 8 blobs being tracked by NXTCam. All the parameters of this function are return values. This function will return color and coordinate information for all the blobs.
nblobs | In this variable, number of blobs NXTCam sees are returned. The blobs NXTCam sees could be of different color or same color. For e.g. if you have 3 colors defined, say red (color 1), blue (color 2) and green (color3), and you have 3 red objects and 2 blue objects and 1 green object in front of NXTCam, nblobs will be 6. color[]: a array of colors for the blobs in above example, Color array will have 6 valid elements - three bytes will say 1 (for color1), and 2 bytes will say (for color 2), and 1 byte will say 3 (for color 3). Based on sorting chosen, they will be sorted by size or color (if the sorting was color, first 3 bytes will be 1, next two will be 2 and next one will be 3). |
color | a array of colors for the blobs (array has 8 elements) |
left | the coordinate values of the blobs (array of 8 elements) |
top | the coordinate values of the blobs (array of 8 elements) |
right | the coordinate values of the blobs (array of 8 elements) |
bottom | the coordinate values of the blobs (array of 8 elements) |
bool EVs_NXTCam::getColorMap | ( | ) |
get the current colormap of the NXTCam
int EVs_NXTCam::getNumberObjects | ( | ) |
get the total number of objected tracked by the NXTCam
bool EVs_NXTCam::illuminationOff | ( | ) |
not impmemented yet
bool EVs_NXTCam::illuminationOn | ( | ) |
not impmemented yet
uint8_t EVs_NXTCam::issueCommand | ( | char | command | ) |
issue character command byte to the command register of the NXTCam (command such as enable tracking, stop tracking, etc). Refer to User Guide for available commands.
bool EVs_NXTCam::pingCam | ( | ) |
ping the NXTCam to test connection
bool EVs_NXTCam::readImageRegisters | ( | ) |
read the image registers of the CCD
bool EVs_NXTCam::resetCam | ( | ) |
reset the NXTCam
bool EVs_NXTCam::selectLineMode | ( | ) |
put the NXTCam in line tracking mode
bool EVs_NXTCam::selectObjectMode | ( | ) |
configure the tracking mode of the device to object tracking
bool EVs_NXTCam::sendColorMap | ( | ) |
send ColorMap to the NXTCam
bool EVs_NXTCam::sortColor | ( | ) |
sort the blobs by color
bool EVs_NXTCam::sortNone | ( | ) |
clear any selected sort configuration
bool EVs_NXTCam::sortSize | ( | ) |
sort the blobs from the NXTCam byt blobs
bool EVs_NXTCam::writeImageRegisters | ( | ) |
write to the image registers of the CCD