Assignment 0: Not So Hot

In this very simple project, you are going to make your PowerShot behave like a digital thermometer. It's really simple. Your ELPH115 actually contains three separate temperature sensors which measure the temperature in integer degrees Celcius in the optics, on the sensor, and in the battery. You are going to write a little Lua program that prints the optics temperature in degrees Fahrenheit every 2 seconds.

Your Project Using CHDK Lua Scripting

Once activated, your Lua script, therm.lua, should measure and print the temperature every 2 seconds as a message in the text console.

The optics temperature is obtained by get_temperature(0), but it is in degrees Celsius. To convert it to Fahrenheit, you simply multiply by 9/5 and add 32. However, be warned that the Lua inside CHDK does not handle floating point values... so multiply by 9, then divide by 5, then add 32. Given that the sensor data was returned as integer degrees Celcius, you don't need to worry about showing decimal places on the Fahrenheit temperature -- it isn't even accurate to +/-1 degree.

There should be one parameter to your script that can be set by the script user:

Stuff To Know About

Obviously, the first step is loading CHDK into your camera. You don't need to build CHDK from sources in order to run your own Lua scripts.

You probably have never used Lua before. It's ugly, but fairly powerful. The CHDK version is only missing a few features, most notably floating-point arithmetic, from the full Lua language and has many additional CHDK-specific functions. There are a number of Lua scripts that you can and should use as references for how to do what you need to do. Be aware that most scripts are not written in Lua, but uBASIC -- they will not be so helpful, and many are old and/or specific to particular camera models.

To make things easier, I've created a reference card for CHDK Lua which you can get from here.

Due Dates, Submission Procedure, & Such

Before you can submit anything, you must register with the class server.

You will be submitting source code (for your Lua script, therm.lua), a make file (which does nothing much for this project), and a very short, simple HTML-formatted, "implementor's notes" document that discusses any issues in implementation or problems with functionality. In that document, be sure to also briefly answer the question: Does the temperature sensor produce consistent readings over time? For example, does the temperature reading slowly drift up, down, or all over the place?

For full consideration, your project should be submitted no later than September 24, 2015. Submit your .tar or .tgz file here:

Your email address is .
Your password is

Which type of student are you?
Undergraduate registered for EE599
Graduate registered for EE699


http://aggregate.org/CACS/ Cameras as Computing Systems