Hello, I am using the Arduino Nano BLE Sense for a school project where I am using some force sensor. I have read that I can play with the accuracy by configuring my voltage reference [ARef]. Because it seem that my reference voltage is set at 1V1. With my calculation, with my analogRead I was supposed to see a value around 248ish_0.2mV for when I apply some pressure on the force sensor. But I have a value of 1092ish_0.8mV.
I have set my analogResolution to 12
//===================
const int pwm = 3;
const int pin1 = A7;
int x = 232;
int value1;
float volt;
float force1;
void setup()
{
Serial.begin(9600);
pinMode(pwm, OUTPUT);
analogReference(DEFAULT);
analogWrite(pwm,x); //PWM OUTPUT 3V
}
void loop()
{
analogReadResolution(12);
value1 = analogRead(pin1);
volt = value1 * (3.3 / 4095.0);
force1 = volt * (220.0 / 3.3);
Serial.print(" Value = ");
Serial.print(value1);
Serial.println(" bit");
Serial.println(" ");
Serial.print(" Volt= ");
Serial.print(volt);
Serial.println(" V");
Serial.println(" ");
Serial.print(" W = ");
Serial.print(force1);
Serial.println(" lb");
Serial.println(" ");
delay(500);
}
I have tried the analogReference(EXTERNAL); command. But when you select the Nano BLE Board in the IDE, that command cant seem to compile.It doesn't reconize the EXTERNAL part.
As I am reading about it, it seem there's nothing about it for this new board.
I get this error message:
'DEFAULT' was not declared in this scope
Does someone have an idea of what can be done?