So, now that I have a Raspberry Pi and I can read the temperature with a TC74 over USB, I thought it would be nice to combine them together.

Because the Raspberry Pi makes use of the ARM architecture, a re-compilation of temp.c is necessary.

(click for larger image)

After compiling temp.c, everything just works like on a normal PC… Great! :)

As a test, I have then installed a webserver (boa) on the Raspberry Pi and created a little webpage that displays the current temperature.

The index.html of this simple webpage looks like this:

<meta http-equiv="Refresh" content="4">
<body style="margin:0px;" background="background.png" text="#000000"  bgcolor="#E0E0E0" link="#0000FF" vlink="#800080" alink="#FF0000">

<h1>Test : Raspberry Pi Debian GNU/Linux + PIC18F4550 TC74 USB</h1>

<h2>The temperature is now <b><script type="text/javascript" src="/cgi-bin/temp"></script><noscript>No JavaScript support!</noscript></b>C.</h2>


And cgi-bin/temp looks like this:

echo Content-type: text/html
echo "document.write(\"`/home/pi/usb/temp`\");"

When I connect with a normal web browser to the Raspberry Pi, I get a simple webpage that displays the temperature:

It should also be possible to connect a TC74 directly (via I²C) to the GPIO pins of the Raspberry Pi, mmmm,… maybe something for a next post ;)