Music Page Turner

Last Updated or created 2024-04-12

UPDATE: 20230320 new version

My first version of the Bluetooth page turner.

This was made using an Arduino and some buttons.
I’m using Fbreader and Ebookdroid on the tablet.

Code:

Note: Volume buttons work for both apps, if you want to use other keys, you need to put a keymap.xml file in your fbreader books directory on your android device to remap those!

#include <BleKeyboard.h>

#define RIGHT_TURN 4
#define LEFT_TURN 5

BleKeyboard bleKeyboard("fashpageturner", "Bluetooth Device Manufacturer", 100);

void setup() {
  bleKeyboard.begin();
  
  pinMode(LEFT_TURN, INPUT_PULLUP);
  pinMode(RIGHT_TURN, INPUT_PULLUP);
}

void loop() {
  if (bleKeyboard.isConnected() && !digitalRead(RIGHT_TURN)) {
    bleKeyboard.press(KEY_MEDIA_VOLUME_UP);
    delay (100);
    bleKeyboard.releaseAll();
  }
  if (bleKeyboard.isConnected() && !digitalRead(LEFT_TURN)) {
    bleKeyboard.press(KEY_MEDIA_VOLUME_DOWN);
    delay (100);
    bleKeyboard.releaseAll();
  }

}

NEW Version

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *