Week 12

Interface and Application Programming

Assignment:

1) Write an application that interfaces with an input and/or output device that you made.

Colorful temperature sensor

I made a board that uses a temperature sensor as an input and two different LEDs as outputs.

As a first test, I programmed the board using a program I wrote (modified) to make the LEDs turn on or off based on the temperature input. Above a set temperature, the red LED would turn on. Below that temperature, the blue LED would turn on.

To visualize the input, first I used Neil's demo python script to display the temperature reading in real time. This worked.

Next, I wanted to see if I could change the output colors of the temperture script (written in python). The python software foundation has a lot of documentation about different ways to dictate color. I'm not sure though if this is just for changing the color in a terminal, or for changing on any screen.

  • Python Foundation Website instructions for coding colors
  • It looks like Neil's program used Hex code to specify the color (I am definitely not sure about this) so I tried to set the color as a different value using Hex, following the example on the python foundation website.

    Python code for temperature display, with a new color specified on the readout bar.

    I unfortunately did not get to test/show this working this week.

    That's all for now