src/HapTouch.cpp
// readbackGeneric()
// See section 6.2.4 in Haptics Library Designer's Guide (slau543)
// Note that the Haptics Library only defines one readback index (PING),
// so you would generally use the readbackPing() method
readbackGeneric()
See section 6.2.4 in Haptics Library Designer's Guide (slau543)
Note that the Haptics Library only defines one readback index (PING),
so you would generally use the readbackPing() method
readbackGeneric () See section 6 . 2 . 4 in Haptics Library Designer ' s Guide ( slau543 ) Note that the Haptics Library only defines one readback index ( PING ) so you would generally use the readbackPing () method
void HapTouch::readbackGeneric(uint8_t readback_index, char* c, uint8_t n)
{
  int i;
  Wire.beginTransmission(_i2c_addr);
  Wire.write(CMD_READBACK);           
  Wire.write(readback_index);
  Wire.endTransmission(true);
  Wire.requestFrom(_i2c_addr, n);  
  i = 0;
  while (Wire.available() && i < n) {
    c[i++] = Wire.read();
  }
  c[i] = '\0';            
}
void HapTouch :: readbackGeneric ( uint8_t readback_index , char * c , uint8_t n ) { int i ; Wire . beginTransmission ( _i2c_addr ) ; Wire . write ( CMD_READBACK ) ; Wire . write ( readback_index ) ; Wire . endTransmission ( true ) ; Wire . requestFrom ( _i2c_addr , n ) ; i = 0 ; while ( Wire . available ( ) && i < n ) { c [ i ++ ] = Wire . read ( ) ; } c [ i ] = ' \0 ' ; }
readbackGeneric()
See section 6.2.4 in Haptics Library Designer's Guide (slau543)
Note that the Haptics Library only defines one readback index (PING),
so you would generally use the readbackPing() method
readbackGeneric () See section 6 . 2 . 4 in Haptics Library Designer ' s Guide ( slau543 ) Note that the Haptics Library only defines one readback index ( PING ) so you would generally use the readbackPing () method
// Command opcode // Get the Response // Add NULL terminator