Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Bluetooth hid game controller with Teensy 3.1

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    12

    Bluetooth hid game controller with Teensy 3.1

    Hi, i would like to build a bluetooth gamepad with bluefruit ez-key and teensy 3.1(because the bluefruit doesn't have analog pin). I think everything is ok for the connections between the boards but I have no knowledge for coding the teensy in order to make it communicate with the bluefruit
    Can you help me?

  2. #2
    Junior Member
    Join Date
    Feb 2014
    Posts
    2
    From the website it looks like the ez-key already supports basic buttons like the arrow keys and a few others, you should just have to wire a few push buttons to it and you should be good to go without needing to connect an additional microcontroller to it. If you want to reprogram it to send different keys then Adafruit has a tutorial on that here (http://learn.adafruit.com/introducin...h-hid-keyboard).

  3. #3
    Junior Member
    Join Date
    Feb 2014
    Posts
    12
    Yes I know but the problem is that i would like to add 2 joystick to my gamepad and the bluefruit doesn't provide analog pins. That's why i need to connect an additional microcontroller.

  4. #4
    Member
    Join Date
    Dec 2012
    Location
    Des Moines, Iowa, USA
    Posts
    24
    Quote Originally Posted by bigshaq10 View Post
    Yes I know but the problem is that i would like to add 2 joystick to my gamepad and the bluefruit doesn't provide analog pins. That's why i need to connect an additional microcontroller.
    Adafruit has some example code that shows how to send keyboard and mouse messages via Bluefruit EZ-Key. I have asked in their forum if it is possible to act like a joystick device, which is what I will need to do for things like the Android-based OUYA.

    Here is their page on sending commands serially to the EZ-Key so they are transmitted via Bluetooth:

    http://learn.adafruit.com/introducin...eys-via-serial

    There is sample code there that could be easily used on the Teensy.

  5. #5
    Junior Member
    Join Date
    Feb 2014
    Posts
    12
    Hi,
    i finally gave up for making my bluetooth gamepad with the ez-key. I would like to make it with another bluetooth module like this one, http://www.rayson.com/rayson/en/uplo...e/NP0016_1.jpg.
    I have some problems for coding the teensy, i found a sample code in arduino example but it only works with usb and i would like to make it work in bluetooth.

    Can u please help me?

  6. #6
    Junior Member
    Join Date
    Oct 2014
    Posts
    1
    First, sorry for reviving a few month old thread.

    I am too also looking at doing something similar. I was planning to purchasing a teensy and using a bluetooth module to make a Bluetooth Gamepad/Joystick. So far what I figured is that the teensy would communicate with the Bluetooth Module via the TX & RX lines along with a power and ground. The main issue is trying to get the teensy to initialize the bluetooth packets as a joystick/gamepad. After that we would just need to figure out how to pass the joystick data over bluetooth instead of USB.

    So does anyone know how to do the following:
    1) Initialize a bluetooth module as a Joystick/Gamepad
    2) Convert the Joystick commands to Bluetooth instead of USB.

  7. #7
    Unless you get the dev package for those Bluetooth devices (and even then) it will be difficult to convert those serial modules to Joystick Bluetooth devices. I have some of those 8 dollar BT serial devices and am on the email list for the dev environment for them. However, they are a completely different animal. You have to connect a custom programming device to the ones I have to even change the firmware. I have not done this as I am using mine as serial devices.

    One thing you could do is use 2 micros and 2 bluetooth serial devices. Have one micro collect the analog data and send over a bluetooth master device, then have a bluetooth slave device grab the serial from it and send to a micro connected to the computer (the one on the computer would be set as a joystick USB device). Even this might require the dev environment for those BT devices. I don't know.

    Another possibility is use the bluetooth serial device and write custom software on the PC to emulate a joystick from inputs from the serial device.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •