Skip to content

15. interface and application programming

This week task as below:

  • Individual project

Write an application that interfaces a user with an input and/or output device that you made

Using serial port connection between two computers to test the interface

Step 1:

In my first computer (black colour), I have to connect the USB TTL Board for testing the serial COM port function.

Step 2:

In the device manager, I know that it is COM 3 port.

Step 3:

I will use the other computer(white colour ) together. That computer also connect to the other USB COM port.

Step 4:

On both of my computers, I have installed a OpenJumper software.

It is used to send data through a serial COm port.

Step 5:

In my second computer(white colour), a “Hello” message keep sending from my second computer through the serial COM port cable. The baud rate is set to 9600.

Step 6:

In my first computer(black colour), the OpenJumper software keep receiving “Hello” message from my second computer(white colour).

Step 7:

Python program for the interface.

I have to use the Fab Academy (week 11) python program as a template. http://academy.cba.mit.edu/classes/input_devices/color/hello.VEML6040.py

Step 8:

Here is the modified code for my python program. It is my interface for the user to know the temperature and fan status.

Here is the source code for my python program

Please click here to download the ino file

Step 9

In my second computer, I am going to send the following data to my first computer.

Temp: 12.23\n

Fan:0 \n

It is also the prototype between two computers.

Step 10

This is the interface in my first computer.

Since the above data is received, it is converted to the below message in the interface program.

Temperature is 12.23 degree celsius and FAN status is OFF.

Step 11

Fan status is change to 1. That’s mean turn on the fan. In my second computer, I am going to send the following data to my first computer.

Temp: 12.23\n

Fan:1 \n

It is also the prototype between two computers.

Step 12

This is the interface in my first computer.

Since the above data is received, it is converted to the below message in the interface program.

Temperature is 12.23 degree celsius and FAN status is ON.

Reading data from my board. Show the temperature in my computer.

Problem is found in my chip.

As you read from the error message below.

The sketch uses 5100 bytes (124%) of my program.

Therefore I cant download the program into my chip.

ATTiny 44 is 4k size only

I will buy a new ATTiny 84 with 8k size so that it can best fit to my program

Group assignments

Here is the link of the group assignment .


Last update: July 3, 2021