V3_HEX = 0xFE; // simulation HEX from I2C deviceString stringOne = String(V3_HEX,DEC); //conversion HEX to DECint a=stringOne; << what can't I use this command ?
uint8_t var1 = 65; // Small intuint8_t var2 = 0x41 // Small intSerial.println(var1 + var2, DEC); //This should output 130Serial.println(var1 + var2, HEX); //This should output 82 (or 0x82)
uint8_t varA = 0x01; //1 Decuint8_t varB = 0x71; //113 Decuint16_t myVar = 0;myVar = varA; //1 DecmyVar <<= 8; //Left shit 8 bits, so from 1 Dec it's not 256 Dec. From 0x01 to 0x100;myVar = myVar | varB; //OR operation, basically 0x100 merged with 0x71, which will result in 0x171Serial.println(myVar,DEC);Serial.println(myVar,HEX);
V3_HEX = 0xFE; // simulation HEX from I2C deviceV3_DEC = V3_HEX *2 * 0.0078125; Serial.println (V3_DEC,2); // the result = 3.97 (DEC)
I haven't looked in detail into your code but have you tried to run the I2C scanner to confirm the device is there? http://playground.arduino.cc/Main/I2cScannerAlso in the getData function you're have the endTransmission after the return... so it never gets executed if the function is returning something.Cheers