The Due, Zero and MKR Family boards have 12-bit ADC capabilities that can be accessed by changing the resolution to 12.
This will return values from analogRead between 0 and 4095.
How do I enable this in B4R?
The Due, Zero and MKR Family boards have 12-bit ADC capabilities that can be accessed by changing the resolution to 12.
This will return values from analogRead between 0 and 4095.
How do I enable this in B4R?
Hello again I try to use this code:
But I do something wrong i get error
b4r_main.cpp:35:23: error: expected constructor, destructor, or type conversion before '(' token
analogReadResolution(12);
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
RunNative("analogReadResolution", Null)
analog_A0.Initialize(analog_A0.A0,analog_A0.MODE_INPUT) 'Tempsensor
End Sub
C:\project\B4R\TJMQTT~1\Objects\bin\sketch\b4r_main.cpp: In function 'void Set_ADC_12bit(B4R::Object*)':
b4r_main.cpp:37:26: error: 'analogReadResolution' was not declared in this scope
analogReadResolution(12);
^
exit status 1
C:\project\B4R\TJMQTT~1\Objects\bin\sketch\b4r_main.cpp: In function 'void Set_ADC_12bit(B4R::Object*)':
b4r_main.cpp:37:26: error: 'analogReadResolution' was not declared in this scope
analogReadResolution(12);
^
exit status 1
Do you have installed all lib's in the Arduino IDE for your MKR1010 ?
Write a short programm in the Arduino IDE which call's the analogReadResolution(12) function.
This code compiles fine when I set the board type to Arduino Due:
B4X:
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
RunNative("Set_ADC_12bit", 0)
End Sub
#if C
void Set_ADC_12bit(B4R::Object* o)
{
analogReadResolution(12);
}
#End if
Ok first i can´t find board type Arduino DUE in my boardlist is there an update to my boardlist?
I tested with MKR1000 and that compiled without any error.
So I changed back to MKR1010 and now it actually compiled without any error ??????? very strange??
Now it´s running.