This article demonstrates how to use App Inventor’s BLE (Bluetooth Low Energy) component to control Arduino 101 robotarm (It’s the same structure with mearm, four freedom degrees to a desktop machine arm). Please note that BLE component hasn’t been published, please use the test server http://ble-test.apinventor.mit.edu Related Articles
Part List
1. Arduino 101
2. Android phone (Must have BLE hardware, but I think it’s not a problem for most Android devices today).
3. MeArm or any similar structure of 4-axis Robot Arm
App Inventor Designer: In addition to BLE , the most frequently used components are buttons and labels. Just something you can arrange your button in your viewer. The concept of operating the App is that when you press a button, it will send the signal to make Arduino robotarm to do an action, when you release the button, the action will immediately stop, which use the button events, TouchUp and TouchDown. App Inventor Blocks:
Initialization: When the program starts, the program will ask BLE device for scanning.
Connection and disconnection: When you press the connect button, it will initiate the connection to the specified BLE device (Arduino 101). If successful, you’ll see a message in the [Screen1.Title]. When disconnected, the reverse operation will be performed on the screen, all the buttons will become inoperable (Enabled = false). Press the button: we only describes ButtonArmB1 (the button which hand out the front arm). Please note that we use the buttons in this TouchUp and Touchdown and other two events. There are eight buttons on the screen, with the button events. The viewer is very full! Actually, this wording is too long, you can use the subroutine to manage your program.In fact, it just sent the different parameters, it is easy to make the program more cleaner!
Arduino 101 Code
|