I have an ípega Bluetooth based game controller that is designed to pair with a smart phone and send keystrokes to simulate the buttons of the joysticks and other buttons.
I would like to combine a Bluetooth library keyboard library with some translation between the keystrokes of the ípega such that it functions as if it was a remote control for the servos of an arduino uno based makeblock robot.
shrek:
I have an... arduino uno based makeblock robot
starter kit, Bluetooth version, sold at one point in RadioShack retail stores.
Website is http://www.makeblock.cc/starter-robot-kit/ and I have the blue colored Bluetooth enabled version.
If your Robot can receive Bluetooth then you should be able to connect to it with an Arduino and a Bluetooth module - perhaps a HC06.
You have not posted a link to the "ipega" game controller so I don't know what it does.
If you want your Arduino to connect by Bluetooth to the game controller (to receive commands) and to the Robot (to send commands) I suspect you will need two Bluetooth modules on the Arduino. That suggests that it would be best to use a Mega which has 4 hardware serial ports which will make the process much easier.
However, if the Arduino can control the Robot (and push-buttons and/or a joystick could be attached to the Arduino) I wonder if it is necessary to use the "ipega" at all.
This is the link to the ipega game controller that I have.
The "Arduino" is actually a MakeBlock derivative based on Arduino Uno software (which is to say that in the Arduino IDE you choose Arduino Uno as your target board) however the header for interfacing other hardware has been modified to make the pins connect based on the attached image taken from http://wiki.makeblock.cc
There is very little information in the ipega link. You would need to know what it transmits in order to write Arduino code to make sense of the data. And it may be that it can only work with one of the listed operating systems.
You could possibly write a generic Bluetooth receive program for your Arduino and it may show you what data is being sent when you press different buttons. The examples in serial input basics might be a starting point.
If you cannot work out what data is being sent from the ipega you can't even get the project started.
A link to the datasheet for your "MakeBlock" is also essential to make sense of it.
It would probably be much easier to do your exploration on a regular Uno that everyone here is familiar with.
Robin2:
... You would need to know what it transmits in order to write Arduino code to make sense of the data.
I have mapped the button's label to the keystroke.
Therefore I expect I won't need a generic Bluetooth receive program as you state.
Robin2:
You could possibly write a generic Bluetooth receive program for your Arduino and it may show you what data is being sent...
when you press different buttons. The examples in serial input basics might be a starting point.
The following are the results
when paired to my mac by press and hold [A] followed by [Home] until search light is intermittent and I pair and connect from the computer
[A] -> j
[B] -> k
[Y] -> i
[X] -> m
{right trigger} -> p
{left trigger} -> q
[SELECT] -> r
[START] -> y
{D-pad}[up] -> ↑
{D-pad}[left] -> ←
{D-pad}[down] -> ↓
{D-pad}[right] -> →
{left joystick}[up] -> ↑
{left joystick}[left] -> ←
{left joystick}[down] -> ↓
{left joystick}[right] -> →
when paired to my mac by press and hold [B] followed by [Home] until search light is intermittent and I pair and connect from the computer
[A] -> uf
[B] -> hr
[Y] -> yt
[X] -> jn
{right trigger} -> kp
{left trigger} -> im
[SELECT] -> ""
[START] -> ""
{D-pad}[up] -> we
{D-pad}[left] -> aq
{D-pad}[down] -> xz
{D-pad}[right] -> dc
{left joystick}[up] -> we
{left joystick}[left] -> aq
{left joystick}[down] -> xz
{left joystick}[right] -> dc
Note {right joystick}[any direction] did no discernible modifier or regular keystroke therefore I did not include it
legend
[] indicate an actual button
{} indicate the common name of a group of buttons or single button
-> indicates and should be read as "maps to"
"" indicates no discernible modifier or regular keystroke
What program were you using on your MAC to get the output in Reply #6?
It's been a while. Maybe I am mixed up.
Do you want your Arduino to send the same characters that you have figured out using your MAC? If so that should be straightforward. What have you tried - post your latest code.
During the initial pairing Mac OS X ran "Keyboard Setup Assistant" and was unable to determine the type of keyboard that this Bluetooth game controller corresponds to at which point I was forced to choose an ANSI type keyboard because it's printing characters are what I am accustomed to. The choices available in the "Keyboard Setup Assistant" are seen in the attached image.
I used Notes.app to determine the printing characters as well as System Preferences.app: Keyboard page: Modifier Keys subpage to determine the arrow keys which are non-printing. Next I opened up the Emoji and Symbol viewer in order to insert the printing version of the arrow keys. All of these applications come with Mac OS X El Capitan by default.
Robin2:
...Do you want your Arduino to send the same characters...
I don't want arduino to send these characters but to receive these characters and translate them to forward or reverse and left or right where in the percent of maximum speed will be determined by the key repeat rate i.e. the faster the keys come in the higher the output velocity.
I was thinking, for the sake of simplicity, of using the first pairing method that corresponds to button A + HOME button, which I can use the START button to start/stop an autonomous mode that I plan to implement later, the SELECT button to possibly cycle from 0% speed to 100% in 20 percentile increments, last but not least I can use either the D-Pad or left joystick to control left right and the A button for accelerate forward b for backwards a.k.a. reverse.
shrek:
I don't want arduino to send these characters but to receive these characters and translate them to forward or reverse and left or right where in the percent of maximum speed will be determined by the key repeat rate i.e. the faster the keys come in the higher the output velocity.
That should receive the data. You would need to add a little code to measure the time between receipt of characters.
I don't like the idea of relying on the repeat rate. Is it not possible to have a key to "increase speed", another key to "decrease speed". In any case, how are you going to vary the repeat rate?