So I’m taking some code that was written for the ESP32 chip that I am modifying to run on an Argon.
I am getting errors due to the “dtostrf” in the code so I need some help figuring out the best way to fix the error.
Instead of assuming I know the best way to fix this I figure I would ask people smarter than me for some help with a the most efficient alternative to eliminate the errors.
Is it sprintf()
?
If so can anybody throw me a bone about how I would make the change?
char vin[10], vout[10], vbat[10], iin[10], ibat[10], die_temp[10], bsr[10], thermistor_voltage[10], tcharge_timer[15], tcv_timer[15], temp[15];
LTC4162_read_register(<c4162, LTC4162_VBAT, &data);
dtostrf(LTC4162_VBAT_FORMAT_I2R(data) * cell_count, 5, 3, vbat);
LTC4162_read_register(<c4162, LTC4162_VIN, &data);
dtostrf(LTC4162_VIN_FORMAT_I2R(data), 5, 3, vin);
LTC4162_read_register(<c4162, LTC4162_VOUT, &data);
dtostrf(LTC4162_VOUT_FORMAT_I2R(data), 5, 3, vout);
LTC4162_read_register(<c4162, LTC4162_IBAT, &data);
dtostrf(LTC4162_IBAT_FORMAT_I2R(data), 5, 3, ibat);
LTC4162_read_register(<c4162, LTC4162_IIN, &data);
dtostrf(LTC4162_IIN_FORMAT_I2R(data), 5, 3, iin);
LTC4162_read_register(<c4162, LTC4162_DIE_TEMP, &data);
dtostrf(LTC4162_DIE_TEMP_FORMAT_I2R(data), 5, 3, die_temp);
LTC4162_read_register(<c4162, LTC4162_THERMISTOR_VOLTAGE, &data);
dtostrf(LTC4162_NTCS0402E3103FLT_I2R(data), 5, 3, thermistor_voltage);
Any help is appreciated