Tool/software:
Hi,
I'm trying to use the example code for TMAG3001 provided here: www.ti.com/.../TMAG3001, it looks to me like the RESULT_READ_CALCULATION_EXAMPLE is the most relevant to what I do, so I chose that one. So my code starts with all the hardware inits and InitTMAG3001(); then
int16_t xyz_raw_results[3] = {0}; // Array to store the raw data from the magnetic channel registers
float xyz_mT_results[3] = {0}; // Array to store magnetic channel data in mT
// Configure device settings
TMAG3001enableMagChannels(MAG_CH_EN_XYZ); // Configure MAG_CH_EN bits to enable magnetic channels
TMAG3001enableAngleMeasurement(ANGLE_EN_X1stY2nd); // Configure ANGLE_EN bits to enable angle calculations
TMAG3001setRanges(RANGE_80mTor240mT, RANGE_80mTor240mT); // Sets the magnetic range of the device
// Trigger data conversion
TMAG3001readSingleRegisterWithTrigger(SENSOR_CONFIG_2_ADDRESS); // Trigger a conversion using an I2C read command
delay_ms(1); // Delay to allow conversion to complete
// Get result measurements
float temperature = TMAG3001getMeasurementTEMP(); // Gets device temperature result measurement in degrees C
float xResult = TMAG3001getMeasurementX(); // Gets device X-axis result measurement in mT
float yResult = TMAG3001getMeasurementY(); // Gets device Y-axis result measurement in mT
float zResult = TMAG3001getMeasurementZ(); // Gets device Z-axis result measurement in mT
float angle = TMAG3001getMeasurementANGLE(); // Gets device angle result measurement in degrees
float magnitude = TMAG3001getMeasurementMAG(); // Gets device magnitude result measurement in mT
// Gets all raw magnetic flux data as well as magnetic flux data in mT
TMAG3001getMagResultsRegisters(xyz_raw_results); // Gets all magnetic flux data measurements in mT
TMAG3001getMagMeasurements(xyz_mT_results); // Gets all raw magnetic flux data
Everything I read from this code is 0.0. am I missing something here? I only have SCL SDA, VCC & GND connected. Do I need more?
Thanks in advance!
