jueves, 23 de enero de 2014

Raspberry Pi + PIC18F4550 TC74 USB

21:33

Raspberry Pi + PIC18F4550 TC74 USB 

 

http://www.janwagemakers.be/wordpress/?p=182

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

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

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

</body>
</html>
And cgi-bin/temp looks like this:
#!/bin/bash
echo Content-type: text/html
echo
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

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comentarios:

Publicar un comentario

 

© 2013 Antikythera Electronica y domotica. All rights resevered. Designed by Templateism

Back To Top