every piece have sentences that help us to program, making the process really easy. to make the app we will look for the pieces that we have in the image above, we will set them as it is shown in the image. the code says that when the bluetooth is available we will chose a bluetooth client selected by the addresses and names and that when we tap on any of the buttons the app will send a number depending of the button we pressed trough the blue-tooth client the work of the app finished there and the code in every board will decide what to do depending on the number it receives in the serial port thats why we can use the same app for different boards. in case of using the app for other board we just have to remember which button will send which number and expect the action we can verify this with the serial and bluetooth modules in termite using a pc
ABOUT ME
Write an application that interfaces with an input &/or output device that you made, comparing as many tool options as possible for this week assignment i will make an android app in app inventor, this app will be the control interface for my rotational molding machine, it will set 3 preprogrammed speeds and a stop button. this app will be capable to control the output board that also communicates with blue-tooth, thanks to the code that both boards have we can use the same app to control them. the interface and the button names will be designed for the final project but we will test the app with the outputs board and the usb to serial module connected to the bluetooth module this configuration will let us see in the pc (termite terminal) the data that the app is sending first i will show you how i did the app in app inventor in app inventor we have two principal buttons that switch between the window designer and blocks. in designer we will edit the graphical interface that the app will have, here we can add buttons, pictures and menus in blocks we will program the way each button, menu and picture interacts with the app and the other variables in the button projects we can start a new project or manage the projects that we have. login in with the Google account give us the opportunity to save the projects in the cloud so we can have our project apps in any web browser. the user interface menu let us add components to the app. properties menu let us edit the things we add to the app like size, color, name, text and position components menu let us manage the thigs we have in the app the blocks window is where we program the app. we select the actions that the buttons and menus will trigger. the interface is very intuitive, visual and easy to understand. clicking on any of the blocks menu will show us the puzzle pieces that we can assemble, mixing them will have different results, all the pieces that can be programed will click and fit well, if there's an error the pieces wouldn´t fit correctly this are the configurations in termite to communicate with the bluetooth this is the string that we receive when we press the speed 1 button in the app and speed 2, 3 and stop as we see in the app blocks code, we send from 1 to 4 depending of the button pressed, in the termite terminal in the pc we recieve those numbers we will test the board with the app once we have all tested and working we are now sure that the app works and we can download the apk to do it in app inventor we will click on build and then app (save .apk to my computer) that will let us save the apk to the pc and share it with others to do the tests i build it and save it as a qr then with the smart phone camera i read the qr code to download directly the apk to my smartphone
note: the qr is just for testing the apk when we program, it stops working after two hours i will share the apk in the link below note 2: to install the apk we have to set the permissions in android to instal apk from no official developers this option can be re established after installing the app and the way to do it changes from phone to phone  you can download the apk clicking here this is the program that will let us comunicate one of the problems that i found was to place the buttons and menus in app inventor it was difficult to do it until i find the vertical and horizontal arrangement, even with this tool it is hard to place the things as we want, we have to fill with blank spaces and change the sizes to well place the things. i will use this app to control my final project i invite you to view the final project page.
ASSIGNMENTS
week sixteen interface and application programing
#include <SoftwareSerial.h> SoftwareSerial mySerial(0,1); char c; void setup() { mySerial.begin(9600); mySerial.println("conected"); pinMode(9, OUTPUT); } void loop() { if (mySerial.available()) { c=mySerial.read(); switch(c) { case'1': mySerial.println("ON"); digitalWrite(10, HIGH ); break; case'0': mySerial.println("OFF"); analogWrite(10, LOW); break; } } } final project page
FINAL PROJECT
CONTACT

 

Carlos Pérez Ramírez