Interface and Application Programming

Over View of Assignments

What is Interface and Application Programming ?

An application program (sometimes shortened to application) is any program designed to perform a specific function directly for the user or, in some cases, for another application program. Examples of application programs include word processors; database programs; Web browsers; development tools; drawing, paint, and image editing programs; and communication programs. Application programs use the services of the computer's operating system and other supporting programs. The formal requests for services and means of communicating with other programs that a programmer uses in writing an application program is called the application program interface (API).

Read More

An application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application software. In general terms, it is a set of clearly defined methods of communication between various software components. A good API makes it easier to develop a computer program by providing all the building blocks, which are then put together by the programmer. An API may be for a web-based system, operating system, database system, computer hardware or software library. An API specification can take many forms, but often includes specifications for routines, data structures, object classes, variables or remote calls. POSIX, Microsoft Windows API, the C++ Standard Template Library and Java APIs are examples of different forms of APIs. Documentation for the API is usually provided to facilitate usage.

source , Also Read more

Workflow of making Interface and Application Programming

i have decided to build a application which reads data from the buletooth and sends the values of Temperature to screen, My plan is to make an android app to interface DHT11 sensor and the board designed in the week15 and Bluetooth module HC05 using MIT's app inventor.

App inventor

App inventor is a cloud based software provided by Google and maintained by MIT to create applications for Android systems. First i have gone throuh the documentations and tutorials on how to make the app in appinventor.There is a colection of tutorials are available in mitappsinventorblog. You can follow this documentation on how to start designing apps using app inventor.

First i registered in the app inventor site app inventor. Start a New project ,then you will be directed to the designer window from here we can add the user interfaces like buttons, labels, textboxes, text to speetch etc. Next is the Blocks section after adding the user interfaces into the designer part we can move to blocks section. In the blocks editor the user interfaces we added from designer section can be connected to perform the tasks, for each user interfaces number of palettes will be available. The palettes can be picked and placed in the block design area and connected with other palettes.

Building the Temperature App

i have learned through couple of books and i have made the app using the MIT App inventor can seen here

Main screen of the App
Blocks of the App
QR Code to download the App

now finally download the app and upload the designed arduino code for the app

code for app

  1. #include<SoftwareSerial.h>
  2. #include "DHT.h" //include DHT library
  3. #define DHTPIN 2 //define as DHTPIN the Pin 2 used to connect the Sensor
  4. #define DHTTYPE DHT11 //define the sensor used(DHT11)
  5. int bluetoothTx = 10; // connect tx of bluetooth to 10th pin
  6. int bluetoothRx = 11; // connect rx of bluetooth to 11th pin
  7. SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
  8. DHT dht(DHTPIN, DHTTYPE);//create an instance of DHT
  9. void setup() {
  10. pinMode(3,OUTPUT);//blue pin of rgb led
  11. pinMode(4,OUTPUT);// green pin of rgb led
  12. pinMode(5,OUTPUT);//red pin of rgb led
  13. Serial.begin(9600);// serial communication begins
  14. delay(6000); //wait 6 seconds
  15. dht.begin(); //initialize the Serial communication
  16. bluetooth.begin(9600);// bluetooth communication begins
  17. }
  18. void loop() {
  19. float temp = dht.readTemperature(); // read Temperature as Celsius (the default)
  20. Serial.println(" "); //
  21. Serial.println(temp); // watch the current temperature in serial monitor
  22. bluetooth.print(" ");
  23. bluetooth.println(temp); // send temperature to bluetooth device
  24. delay(2000);
  25. if (temp <= 30){ // if temperature is below 30 turn on blue light
  26. digitalWrite(3,LOW);
  27. digitalWrite(4,LOW);
  28. digitalWrite(5,HIGH);
  29. }
  30. else if (temp >30 && temp <=34){ // if temp is above 30 and below 34 turn on green light
  31. digitalWrite(3,LOW);
  32. digitalWrite(4,HIGH);
  33. digitalWrite(5,LOW);
  34. }
  35. else if(temp >36){ // if temperature is above 36 turn on red light
  36. digitalWrite(3,HIGH);
  37. digitalWrite(4,LOW);
  38. digitalWrite(5,LOW);
  39. }
  40. }

Error Faced

i have made a seperate power board for the week15 so i has lacking vcc and ground in the base board to supply the power to the sensor,so i have connected the sensor board with the power source and the power source of the board is seprate i was getting random weired value in app "nan" then i was able to find it kept the both one the same power source my app started reciving the correct data

Error seen in App
Solved making all the components to same power source

Output working video and the download application below

Hero Shot

Now here we comes to the Hero Shot of this Week

Hero Shot

Implimentation of Interface and Application Programming final Output

Conclusion

  • We had great time working with the Interface and Application Programming
  • Understand the problems occur while developing the android app using android studio
  • © 2017, made with by scitechindian

    Creative Commons License

    This work done by SYED JUNAID AHMED is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.