Introduction
BlackBerry 10 is a proprietary mobile operating system developed byBlackBerry Limited (formerly Research In Motion) for its BlackBerry line of smartphone and tablet handheld devices. Devices running BlackBerry 10 are the Q5, Q10, Z3, Z10, Z30 and the P’9982 smartphones. BlackBerry 10 is based on the QNX operating system, which is popular in industrial computers and used in many car computers, which was acquired by BlackBerry in April 2010.(1)
The BlackBerry 10 operating system uses an innovative combination of gestures and touches for navigation and control. These make a “back” button unnecessary and it is actually possible to enter all commands on the BlackBerry 10 operating system without having to press any of the physical buttons, with the exception of the power button that switches the device on/off.(1)
BlackBerry 10 introduced an Android runtime layer. This allows developers to easily package and distribute their applications designed to work on the Android platform. As of BB10.2, applications developed for Android 4.2.2 (Jelly Bean) and below are supported.(1)
Basic gesture of swipe to control movements of a robot can be quite interesting, and may add an intuitive interactive dimension to electronic projects.
I have published in this blog several tutorials on 8051-based robot controlled with Bluetooth-enabled cell phone. Some time ago I published also two tutorials for Android phone one using button images on device’s touchscreen and another basic gestures of swipe on touchscreen.
Requirements
A 8051 robot “Robo-51” (could be a robot with any other micrcontroller) with serial bluetooth ZX-Bluetooth module, running a firmware for bluetooth control, and an account with App Inventor.
App Inventor Code
Our code is based on two codes BennyBlue and Swype routine both made with App Inventor .
To be able to control the robot you will need to download the source code file Bluemote2_2.zip kept at Bitbucket, an unlimited free private repositories’ site. If you already have an App Inventor folder, you can download the source code by scanning the following QR barcode:
Downloading the Android apk
If you are absolute beginner with App Inventor, the excellent resources and tutorials found at MIT’s App Inventor site are very good and easy to follow. Once installed, the source code you will need to download the Android apk. The screen and app has been optimized for Z10 .
Converting apk to bar
The downloaded apk will have to be uploaded to Good Reader’s website to convert into BB10 bar file. The link to apk2bar online converter is:
http://apps.goodereader.com/apk-2-bar/
I have found Good Reader’s website to be friendly and easy to use. If you are too lazy to go through the previous two step you can download the bar app clicking here. If eventually the bar app is not available at the link, you can download clicking Bluemote2_2.bar kept at Bitbucket.
Side-loading the bar file into Blackberry 10 smartphone
The following Good Reader’s link has a tutorial on how to install bar app into your Blackberry 10 smartphone (my app is optimized for Z10): http://apps.goodereader.com/playbook/playbook-android-apps/?did=177 It has also a video on how to install in Z10. You will need to turn Development Mode On and select an easy to remember Password to be able to install the bar app.
The control program
The Blackbery 10 application controls Robo-51 from Inex, with the following Bluetooth send commands: Key letter “d” results in forward movement of the robot, “a” in backward, “c” in turning leftward, “b” in turning rightward and “s” in stopping. Gestures on the screen of BlackBerry 10 send these commands to Robo-51 in order to control it. The following image of the BlackBerry shows the app’s icon (inside the red square) after it has been installed:
Pairing the Bluetooth module to Blackberry
Before running the application, you will need to pair the Bluetooth module on Robo-51 with your BlackBery’s Bluetooth:
Running the App
Next, when you run the app you will need to tell it which paired devices, your BlackBerry will it talk to by clicking Select Device:
Which in our case is the Spp device which you will select by clicking on it:
Note MAC addresses are not shown at all. You will see your MAC addresses.
We will then connect, clicking the Connect button:
I have blurred the MAC addresses of my Bluetooth modules. Your will have your own MAC addresses. Once connected you will hear “I’m Robo-51 I’m at your command” and the screen will show the button Disconnect:
You can control the robot with gestures of swipe with the finger to the left, or to the right, or forward (up finer swipe gesture) and backward (with down finger swipe gesture) , and you will hear in your Android phone voice of corresponding “forward”, “backward”, “turning left” etc. and the robot will move accordingly leftward, rightward, forward and backward. The Reset/Stop button will stop the robot.
After you have played with the control of the robot, you can disconnect by clicking on Disconnect button on top right of BlackBerry screen. Clicking More at bottom right of your phone’s screen you will see the option to close the app:
By clicking Stop this application you will have be asked if you want to continue or go back to application:
Video demonstration
The following Youtube video demonstrates basic swipe gestures on my BlackBerry 10 smartphone (Z10 4G LTE) controlling the robot (Robo-51) :
Conclusion
This project adds a new feature into existing Robo-51 projects. The main objective of this actual project was to achieve, with little work, similar results to those obtained with Java-based Nokia N97 and BlackBerry Bold 9700 and Android phones. I can now tick as successful this project on basic gestures of swipe for BlackBerry 10.