uncategorized

Week 16- Interface and application programming

Objective

We are supposed to make an interface. It can be for anything, just a bar showing the data from a sensor or something for communication etc. In short make anything which has an interface.

The plan

I have seen Neil using TkInter in the input devices examples, also I have heard about MIT App Inventor. One of my friend suggested Qt and i will have a look of that too.

Learning

This is all together a new domain for me. I am not a UI kind-of person, i use minimum UI in my OS too. So i am looking for some beginners stuff. I started with the app inventor which seems to suit for beginners. It also reminded me of Scratch which is an awesome peace of software for learning something from scratch. So I will move in the AppInventor -> TkInter -> Qt order.

My assignments

AppInventor

After registering in their website and a little help from appinventor.org i was able to start working on the interface. It has two windows, the designer and blocks, where the former has a drag and drop interface and latter looks similar to scratch.
The design workflow of my app is

  • Designer Window: Here first I added a list picker, from the user interface option under palette section, and in its properties gave the name LED in the text box.
  • Designer Window: Grabed the horizontal arrangement tool from the layout category and added 2 buttons to it fpr displaying ON and OFF options.
  • Blocks window: here i added controls for the list-picker to select the Bluetooth devices in the vicinity and then instructions to send a o when ON button is pressed and a 1 when OFF is pressed.

Logic select the device
Logic to show when connection is established
To send `1` when ON is pressed
To send '0' when OFF is pressed

After all this, I came up with something like this:

The Designer

The blocks

And there is a feature where you can build it and export as an .apk file which can be installed in an android devices. So after writing the code i exported it and installed it in my phone. This is the final look:

Screenshot of the final app

I used a controller board made in the electronic design week since it have external resonator.
the work flow is as follows:

  1. switch on the mobile Bluetooth and pair with with the Bluetooth module.
  2. Open the mobile app and click on the LED button which leads to a screen for selecting the Bluetooth module. After selecting the required connection, you will be automatically re-directed to our application.
  3. now you are ready. By clicking on the ON and OFF buttons you can control the LED in the board.

The bluetooth module

module + controller

design files

Share