Please include the following information, in order for us to help you as effectively as possible.
-
What product do you wish to discuss?
RAK11720 mounted on RAK19007 -
What firmware are you using?
RUI3 -
What firmware version? Can it be obtained with AT+VER=?
RUI_BOOT_0.3_RAK11720 -
Computer OS? (MacOS, Linux, Windows)
MacOS -
What Computer OS version?
Sonoma 14.7 -
How often does the problem happen?
Always
I connected a RAK11720 to a Wisblock core RAK19007
The board has many outputs, but the one I will be mentioning is IO1, IO2 and BOOT
I want to connect a button and detect button presses, and to do this I am using #include <ezButton.h>
(EzButton by ArduinoGetStarted.com, 1.0.6)
To find the pin name I refered to RAK-APOLLO3-RUI/variants/WisCore_RAK11720_Board/variant.h at main · RAKWireless/RAK-APOLLO3-RUI · GitHub
Here I find
#define P4 4//IO2
#define P41 41//BOOT0 - SWO
#define P38 38//IO1
I verified that it was the correct ones by doing a simple sketch such as
void setup() {
pinMode(P4, OUTPUT);
}
void loop {
digitalWrite(P4, HIGH);
delay(5000);
digitalWrite(P4, LOW);
}
I then used a multimeter to measure the voltage of the tested pin.
I found that the IO pins were 1.8 V when HIGH, and the BOOT pin was 3.3 V when HIGH.
I then connected a simple sketch that, when the button is pressed, connected one of the IO or BOOT pin to GND.
Then setup a sketch (Sketch simplified, removing Serial.begin() etc)
#include <ezButton.h>
ezButton button(P4);
void setup() {
}
void loop {
button.loop();
int btnState = button.getState();
Serial.println(btnState);
}
When using the BOOT pin this sketch worked, and btnState changes state when button is pressed.
But when using the IO1 or IO2 pins there was no change in state for btnState when the button was pressed.
Is there something special about the IO ping that I am missing, which prevents the button detection from working?
I did expect the IO pins to work better than the re-purposed BOOT pin.
I was not expecting the IO pins to have a stepped down voltage as well.