Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15374

Gpio esp32 ble mouse

$
0
0

hello everyone... I want to make a bluetooth mouse with ESP32. only I'm still confused about creating GPIO parameters to activate the buttons on each board. can anyone help?
this is the code I use
#include <BleMouse.h>

BleMouse bleMouse;
#define Back 25

void setup() {
pinMode(Back,INPUT_PULLUP);
digitalWrite(Baack,HIGH);

Serial.begin(115200);
Serial.println("Starting BLE work!");
bleMouse.begin();
}

void loop() {
if(bleMouse.isConnected()) {
if(digitalRead(Back,LOW)){
Serial.println("Back button click");
bleMouse.click(MOUSE_BACK);
delay(500);}

}

}

but the mouse is always active even if I don't press the button

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 15374

Trending Articles