I want to measure resistance using NHS3152 ADK, I have connected my resistor between ANA0 and ANA4.
I am trying to run i2d_nss_example_1, however i am getting undefined reference to 'current native' error. How do i fix this?
Also, is there a way to display the variables in the variable tab of LPCXpresso? for now they wont show up.
This is the code:
#include "board.h"
extern volatile int current_native;
extern volatile int current_picoampere;
void i2d_nss_example_1(void)
{
//! [i2d_nss_example_1]
int i2dValue;
int i2dNativeValue;
Chip_IOCON_SetPinConfig(NSS_IOCON, IOCON_ANA0_4, IOCON_FUNC_1); /* Set pin function to analog */
Chip_I2D_Init(NSS_I2D);
Chip_I2D_Setup(NSS_I2D, I2D_SINGLE_SHOT, I2D_SCALER_GAIN_10_1, I2D_CONVERTER_GAIN_HIGH, 100);
Chip_I2D_SetMuxInput(NSS_I2D, I2D_INPUT_ANA0_4);
Chip_I2D_Start(NSS_I2D);
while (!(Chip_I2D_ReadStatus(NSS_I2D) & I2D_STATUS_CONVERSION_DONE)) {
; /* wait */
}
i2dNativeValue = Chip_I2D_GetValue(NSS_I2D);
i2dValue = Chip_I2D_NativeToPicoAmpere(i2dNativeValue, I2D_SCALER_GAIN_10_1, I2D_CONVERTER_GAIN_HIGH, 100);
Chip_I2D_DeInit(NSS_I2D);
//! [i2d_nss_example_1]
current_native = i2dNativeValue;
current_picoampere = i2dValue;
}
int main(void)
{
Board_Init();
i2d_nss_example_1();
}