Help bluetooth keyboard from 2 buttons

Hello,
i would like to have 2 buttons (for exemple 1 for “Enter” the other for “Space”) on an arduino, when i press one of them the bluetooth connection with the android tablet will replicate it on the screen.
Basically i want to do a pageflip with bluetooth but when i do it with my purchased pedal it is connected as a keyboard and the one i made android refuse to connect to it but with serial bluetooth applications it works

So i would like some help with the connection maybe i don’t have the bluetooth module for that usage.

I post the code below it works

Thanks for your help

Projet_FlipPedal.ino (1.09 KB)

Can you rephrase the question? It’s not quite clear to me what the problem is.

OP’s code, so we don’t have to download it

#include <SoftwareSerial.h>
#include <TimerOne.h>
#define PIN1 2
#define PIN2 3

SoftwareSerial ARDBT(15, 14); // (RX, TX) (pin Rx BT, pin Tx BT)


#define CAR_D "d"
#define CAR_G "g"

volatile boolean g, d;

void gauche(){
  if(g){
    ARDBT.print(CAR_G"\n");
    Serial.println("gauche");
    g = false;
  }
}
void droit(){
  if(d){
    ARDBT.write(CAR_D"\n");
    Serial.println("droit");
    d = false;
  }
}

void temps(){
  g = true;
  d = true;
}

void setup()
{
    // Ouvre la voie série avec l'ordinateur
    Serial.begin(9600);
    // Ouvre la voie série avec le module BT
    ARDBT.begin(9600);
    Serial.println("Initialisation OK");
    pinMode(PIN1,INPUT_PULLUP);
    pinMode(PIN2,INPUT_PULLUP);
    attachInterrupt(digitalPinToInterrupt(PIN1),gauche,RISING);
    attachInterrupt(digitalPinToInterrupt(PIN2),droit,RISING);
    Timer1.initialize(1500000);
    Timer1.attachInterrupt(temps);
    g = true;
    d = true;
}

void loop() // run over and over
{
    if (ARDBT.available()) {
        Serial.write(ARDBT.read());
    }
    if (Serial.available()) {
        ARDBT.write(Serial.read());
    }
}

@AnotherBeginner, please read https://forum.arduino.cc/index.php?topic=148850.0, specifically point #7 about posting code. Your code is small enough and and it allows people with cell-phones to check it as well.

Ok so I want to make a page flip on an arduino (so in a box in the end), so my pageflip will need 2 buttons one forward and one backward (think a pdf for exemple)

So the arduino part works fine, the code works in serial bluetooth but i can't connect my tablet on the bluetooth network (made by a HC05) i says "unsecured network " and i can't figure out how to make the bluetooth arduino a keyboard on the tablet

I used a Samsung tablet and it's the same now with huawai tablet (the pageflip is not even recognised now)

Hey i really need help for this this project is almost done but the bluetooth part is still not working