Justin

Interface and Application Programming

Goals

  • Create an Application program for boards that we made earlier.
  • Study other interfacing techniques

For this week i decided to use board from elctronic design week and use Kivy for interface GUI Development

MIT App Inventor

MIT app inventor is a Scratch based tool to create mobile app using web browser.

scratch

I used Circuit from my electronic design week which has a led,switch and FTDI pins for interfacing

circuit

For this week i had to interface bluetooth module HC-05 with the board with the board.

Programming

Creating app to control bluetooth in mobile was the easiest of the all the task because MIT app inventor was straight forward Drag and drop tool.

There are two sections in the MIT app inventor part. First one is Design where you can decide the layout of the program. Next one is the code block where you enter the actual program.

Program for the board

                    #include

                        SoftwareSerial myserial(0,1);
                        
                        char data = 0;                   //Variable for storing received data
                        void setup()
                        {
                          myserial.begin(9600);         //Sets the data rate in bits per second (baud) for serial data transmission
                          pinMode(PA7, OUTPUT);        //Sets digital pin A7 as output pin
                        
                        }
                        void loop()
                        {
                          if (myserial.available() > 0) // Send data only when you receive data:
                          {
                            data = myserial.read();      //Read the incoming data and store it into variable data
                            if (data == 'O')           //Checks whether value of data is equal to "O"
                              digitalWrite(PA7, HIGH);  //LED turns ON
                            else if (data == 'F')      //Checks whether value of data is equal to "F"
                              digitalWrite(PA7, LOW);   // LED turns OFF
                          }
                        }
                 

i used the HC-05 Bluetooth module for communication.

It has 6 peripheral pins which can be used to interface with other device.

Four of these pins are connected to FTDI pins of our circuit board.