EVShield
v1.3
EVShield Library Reference by mindsensors.com
|
This class interfaces with NXTServo attached to EVShield. More...
#include <EVs_NXTServo.h>
Public Member Functions | |
EVs_NXTServo (uint8_t i2c_address=0xb0) | |
uint8_t | issueCommand (char command) |
uint8_t | getBatteryVoltage () |
bool | storeInitial (uint8_t number) |
bool | reset () |
bool | haltMacro () |
bool | resumeMacro () |
bool | gotoEEPROM (uint8_t position) |
bool | editMacro () |
bool | pauseMacro () |
bool | setSpeed (uint8_t number, uint8_t speed) |
bool | setPosition (uint8_t number, uint8_t position) |
void | runServo (uint8_t number, uint8_t position, uint8_t speed) |
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 NXTServo attached to EVShield.
EVs_NXTServo::EVs_NXTServo | ( | uint8_t | i2c_address = 0xb0 | ) |
class constructor for the NXTServo with optional custom i2c address parameter
bool EVs_NXTServo::editMacro | ( | ) |
edit the onboard macro
uint8_t EVs_NXTServo::getBatteryVoltage | ( | ) |
get the battery voltage supplied to the NXTServo
bool EVs_NXTServo::gotoEEPROM | ( | uint8_t | position | ) |
Go to given EEPROM position (This command re-initializes the macro environment)
bool EVs_NXTServo::haltMacro | ( | ) |
stop the onboard macro on the NXTServo
uint8_t EVs_NXTServo::issueCommand | ( | char | command | ) |
issue a character command byte to the command register of the NXTServo
bool EVs_NXTServo::pauseMacro | ( | ) |
temporarily pause the running macro
bool EVs_NXTServo::reset | ( | ) |
reset all servos to default
bool EVs_NXTServo::resumeMacro | ( | ) |
resume the onboard macro on the NXTServo
void EVs_NXTServo::runServo | ( | uint8_t | number, |
uint8_t | position, | ||
uint8_t | speed | ||
) |
run the specified to the specified position at the specified speed
bool EVs_NXTServo::setPosition | ( | uint8_t | number, |
uint8_t | position | ||
) |
set the position of a specified servo
bool EVs_NXTServo::setSpeed | ( | uint8_t | number, |
uint8_t | speed | ||
) |
set the speed of a specified servo
bool EVs_NXTServo::storeInitial | ( | uint8_t | number | ) |
store current settings of the given servo to initial default setting and remember when powered on