Code Monkey home page Code Monkey logo

diy-a-ble-keyboard's Introduction

#DIY A BLE Keyboard

##Introduction This is a simple open source BLE keyboard firmware for the nRF51 bluetooth chip.

##How to use

  • Follow the tutorials to set up development environment and test the chip.
  • Download the nRF51 SDK and the S110 SoftDevice . In this case the nRF51 SDK v9.0 and a 51822 module with S110 v8 are used.
  • Find the ble_app_hids_keyboard floder in the SDK, put the .c files in this project in the root directory and the .h files in the config floder
  • If you want to use the nRF51 chip as both a keyboard controller and a BLE controller, you need to connect the keyboard matrix to it. After doing that, set variables of your keyboard in keyboard_map.h and compile the project. After flashing, you should be able to find a Nrodic Keyboard device and that is your BLE keyboard. The lookup matrix uses HID key code defined in Simplified USB HID keycode Table or USB HID to PS/2 Scan Code Translation Table
  • If you only want to use the nRF51 chip as a BLE controller, beside setting the variables, you would need to write some code for the nRF51 to communicate with the keyboard controller, examples can be find in the SDK and more detail information is in here

##How does it work These codes originated from the hid_keyboard example and the cherry example, a timer is setted to scan the keyboard every 25ms. If there are key presses, it will create a report packet in HID keyboard format and send it to the host, when all keys are released, a packet filled with 0 will be sent. If a key is hold, no packet will be sent until it's release, the host can recongnize that the key is holding as it does not recive a released packet (full 0). Doing so is also power saving as there's no need to send packet continously when keys are holded, know more about the HID keyboard packet format in Device Class Definition for Human Interface Devices (HID) and HID Usage Table. Codes on the battery service has been removed and the whole frame work has been simplified.

##Future work

  • Add support to the sleep mode
  • Add support to touchpad

diy-a-ble-keyboard's People

Contributors

i0x0i avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.