Interface and Application Programming

Assignment List

  • individual assignment: ☐
    • write an application that interfaces with an input &/or output device that you made ☐
  • group assignment: ☐
    • compare as many tool options as possible ☐
  • To Conclude & Reflect

Individual Assmignment

Concept: Phone Connecting to a HC-05 Bluetooth Module, power by a pcb board with a led to be turned on.

For the individual assignment we defined that the interface would be done with MIT app Inventor in combination with a bluetooth input/ output device.

The componets:

  • Phone (android)
  • HC-05 Bluetooth Module
  • PCB Board (Mutant fish board)

It became super fast and easy to make an app. I did a carousel, with all the instructions while creating this bluetooth app.


Getting to know the mit app inventor

The process to follow:

1. open screen @ mit.edu app inventor
2. find bluetooth
3. add bluetooht (hidden component)
4. add 2 buttons
5. change text
6. format the alignment
7. format button height to "fill parent"
8. format result
9. change colors acordingly
10. Add a button that says "connec to bluetooth"
11. select the "Designer" button icon to go into the programming by block section of app inventor / select the buttons on the left side (object tree)
12. select a when statement (On button)
13. drop the selected statement
14. select bluetooth client / select when statement
15. drop bluetooth client statement
16. move bluetooth client statement INTO when statement (On button)
17. select under built-in "Text"
18. drop INTO bluetooth client **at this point I was planning to use the rn4871 module ($$$ = activate command mode)
19. insert "1" for simplicity
20. do the same process for the Off Button
21. insert "0" in the text box (Off button)
22. change the rn4871 module.. if you want
23. select listpicker1 / insert 'when "listpicker1" BeforePicking do' statement
24. Insert logic 'set "listpicker1" elemnts to" statement / Also insert 'when "listpicker" after picking do' statement
25. sleect bluetooth module / select 'set "rn4871" selection' / drop INTO when ... afterpicking do statement
26. right-click on 'set "listpicker1"..' and change it to selection *you can manipulate modules this way as well..
27. add 'call "rn4871" connect' block
28. add lstpicker1 selection
29. here is some more logic option to use
30. here are some math comparisons
31. export the app this way!! IMPORTANT!

Export as .apk file to uploading into the phone.

IPhone and .apk fille dont connect.

Other options include: Thunkable

Playing arround with Thnukable app development environment

That system did not have a direct Bluetooth support. Reviewing the Thunkable Platform, it was very similar to the MIT app inventor. With the added textures and a few rearanged options. At least its connectivity option was not offering Bluetooth.

Later found AppyBuilder, an app building system that d id support Bluetooth, and started hacking away at it.

playing arround with appybuilder app development environment

Again a super similar feeling, but didnt work. Hence I thought maybe a bit more reaserch on how to add it into the iphone would work.

Apparently I have to download xcode, for the iPhone. Looking for it in my app store only tutorials. Possibly regional diferences.

After some reaserch I can sign in under: https://developer.apple.com/ but by the time I figured this out it was much to late to actually learn "their way" of coding stuff.

In the end I figure It might be best to just use the android platform. So I will use that instead.

So I did, I used a borrowed android in order to upload an app.

The white cable in the video is actually just charging the phone. In highnsite, I should have not shown it as part of the video, as it is confusing.


#include 'SoftwareSerial.h'
SoftwareSerial BT(PD0, PD1); // RX, TX  BLUE

char dato;
void setup() 
{
    pinMode(A0, OUTPUT);
    digitalWrite(A0, LOW);
    BT.begin(9600); //VELOCIDAD DE COMUNICACION  
   pinMode(13,OUTPUT);
  digitalWrite(13,LOW);
  delay(5000);
}

void loop() 
{
  if (BT.available())
  {
    dato=BT.read();
    BT.print(dato);
  }
  
  if(dato=='1')
  {
    digitalWrite(A0,HIGH);
  }

  if(dato=='0')
  {
    digitalWrite(A0,LOW);
  }
} 
			

To Conclude

I fond this week challenging, it was not complex assignment, but had little support for IOS.[2019-06-17 they have an IOS project on the way in app inventor]

The: me having and Iphone, and attempt to make it work also ate too much of my time. Based on the idea that I have not enough experiance on the development side of the app things.

Its strange the little reference to the iphone app development in the fabacademy. They dont have an open model.

In the future I will be integrating the bluetooth as part of my final project. Something to be planning ahead, as I'm intially planning to use the rn4871 bluetooth module, instead of the hc-05 module. The reason because i did not run it this week was because I have not got an ftdi or serial cable to communicate directly, making the operation more complex than this one.