Raspberry Pi + PIC18F4550 TC74 USB
http://www.janwagemakers.be/wordpress/?p=182
by Jan Wagemakers • • 2 Comments
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.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:
0 comentarios:
Publicar un comentario