<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pauljmac.com/projects/index.php?action=history&amp;feed=atom&amp;title=AVR_web_scraper</id>
	<title>AVR web scraper - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pauljmac.com/projects/index.php?action=history&amp;feed=atom&amp;title=AVR_web_scraper"/>
	<link rel="alternate" type="text/html" href="https://pauljmac.com/projects/index.php?title=AVR_web_scraper&amp;action=history"/>
	<updated>2026-04-21T13:34:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://pauljmac.com/projects/index.php?title=AVR_web_scraper&amp;diff=13&amp;oldid=prev</id>
		<title>Paul: Created page with &quot;This project is an intro to web scraping using an AVR and lantronix ethernet module.  The idea here is to connect to a web server, scrape a specific page, parse everything on it to find the desired data and do whatever I want with said data.  In my project I am scraping temperature data to display in a (somewhat) fancy wall decoration. Every hour it will get the temperature from the webpage and update the 7 segment display. This was a present I made for my Mom who moved...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pauljmac.com/projects/index.php?title=AVR_web_scraper&amp;diff=13&amp;oldid=prev"/>
		<updated>2024-12-08T16:08:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This project is an intro to web scraping using an AVR and lantronix ethernet module.  The idea here is to connect to a web server, scrape a specific page, parse everything on it to find the desired data and do whatever I want with said data.  In my project I am scraping temperature data to display in a (somewhat) fancy wall decoration. Every hour it will get the temperature from the webpage and update the 7 segment display. This was a present I made for my Mom who moved...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This project is an intro to web scraping using an AVR and lantronix ethernet module.  The idea here is to connect to a web server, scrape a specific page, parse everything on it to find the desired data and do whatever I want with said data.&lt;br /&gt;
&lt;br /&gt;
In my project I am scraping temperature data to display in a (somewhat) fancy wall decoration. Every hour it will get the temperature from the webpage and update the 7 segment display. This was a present I made for my Mom who moved to NY from FL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Still to do:&lt;br /&gt;
*Implement error routines in case the scraper page shows an E. Meaning it is unable to retrieve the data from wunderground. &lt;br /&gt;
*Implement a routine to handle a case where the temperature is triple digits, over 99.&lt;br /&gt;
*Implement a routine to handle a case where the temperature is negative. Does not happen to often here in FL. &lt;br /&gt;
&lt;br /&gt;
==modules==&lt;br /&gt;
I used matchport modules because of their wireless capability. Whichever Lantronix module you decide to use you must put it in a specific mode for this application. To put the module in manual mode do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tellnet to the device ip:9999 TCP&lt;br /&gt;
Select channel. I choose 1&lt;br /&gt;
Enter though everything to accept defaults until you get to to ConnectMode, then enter D4 to configure the module to work with the micro.&lt;br /&gt;
Enter though the rest of the settings for defaults&lt;br /&gt;
When you get to the end save the new configuration&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=code=&lt;br /&gt;
This code is really crude at this point, just a proof of concept really. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define F_CPU 8000000&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;avr/io.h&amp;gt;&lt;br /&gt;
#include &amp;lt;avr/interrupt.h&amp;gt;&lt;br /&gt;
#include &amp;lt;util/delay.h&amp;gt;&lt;br /&gt;
#include &amp;lt;avr/pgmspace.h&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#define bit_get(p,m) (((p) &amp;amp; (m)) &amp;gt;&amp;gt; m)&lt;br /&gt;
#define bit_set(p,m) ((p) |= (m))&lt;br /&gt;
#define bit_clear(p,m) ((p) &amp;amp;= ~(m))&lt;br /&gt;
#define bit_flip(p,m) ((p) ^= (m))&lt;br /&gt;
#define bit_write(c,p,m) (c ? bit_set(p,m) : bit_clear(p,m))&lt;br /&gt;
#define BIT(x) (0x01 &amp;lt;&amp;lt; (x))&lt;br /&gt;
#define LONGBIT(x) ((unsigned long)0x00000001 &amp;lt;&amp;lt; (x))&lt;br /&gt;
#define BITVAL(y,x) (((x)&amp;gt;&amp;gt;(y)) &amp;amp; 1)&lt;br /&gt;
#define NOP asm(&amp;quot;nop&amp;quot;)&lt;br /&gt;
#define OUT 1&lt;br /&gt;
#define IN 0&lt;br /&gt;
&lt;br /&gt;
volatile uint8_t x=0, state=0, msd, lsd, letter_waiting=0, parse=0, sec=0, min=0;&lt;br /&gt;
volatile char last_received_char=0;&lt;br /&gt;
volatile uint16_t y=0;&lt;br /&gt;
&lt;br /&gt;
//Interrupt vector names: http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html&lt;br /&gt;
&lt;br /&gt;
ISR(USART_RX_vect){&lt;br /&gt;
	letter_waiting=1;&lt;br /&gt;
	last_received_char=UDR0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
ISR(USART_TX_vect){&lt;br /&gt;
	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
ISR(TIMER1_OVF_vect){&lt;br /&gt;
	TCNT1=0xE17C;&lt;br /&gt;
	sec++;&lt;br /&gt;
	if(sec==60){&lt;br /&gt;
		sec=0;&lt;br /&gt;
		min++;&lt;br /&gt;
		if(min==60){&lt;br /&gt;
			state=2;&lt;br /&gt;
			letter_waiting=1;&lt;br /&gt;
			min=0;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Matchport_Connect(){&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;C&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;7&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;2&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;.&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;2&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;4&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;9&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;.&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;1&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;1&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;9&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;.&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;1&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;5&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;0&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;:&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;8&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;0&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;\n&amp;#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Matchport_GET(){&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;G&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;E&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;T&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039; &amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;/&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;~&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;p&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;a&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;u&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;l&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;j&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;m&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;a&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;c&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;/&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;c&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;l&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;e&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;a&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;r&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;w&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;a&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;t&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;e&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;r&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;.&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;p&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;h&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;p&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039; &amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;H&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;T&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;T&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;P&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;/&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;1&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;.&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;1&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=0x0a;&lt;br /&gt;
&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;H&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;O&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;S&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;T&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;:&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039; &amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;p&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;a&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;u&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;l&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;j&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;m&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;a&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;c&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;.&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;c&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;o&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=&amp;#039;m&amp;#039;;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=0x0a;&lt;br /&gt;
	while ( !( UCSR0A &amp;amp; (1&amp;lt;&amp;lt;UDRE0)) );&lt;br /&gt;
	UDR0=0x0a;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
char Num_to_code(char num){&lt;br /&gt;
	&lt;br /&gt;
switch (num){&lt;br /&gt;
		case 0:&lt;br /&gt;
			return 0x3f;&lt;br /&gt;
			break;&lt;br /&gt;
		case 1:&lt;br /&gt;
			return 0x06;&lt;br /&gt;
			break;&lt;br /&gt;
		case 2:&lt;br /&gt;
			return 0x5B;&lt;br /&gt;
			break;&lt;br /&gt;
		case 3:&lt;br /&gt;
			return 0x4F;&lt;br /&gt;
			break;&lt;br /&gt;
		case 4:&lt;br /&gt;
			return 0x66;&lt;br /&gt;
			break;&lt;br /&gt;
		case 5:&lt;br /&gt;
			return 0x6D;&lt;br /&gt;
			break;&lt;br /&gt;
		case 6:&lt;br /&gt;
			return 0x7D;&lt;br /&gt;
			break;&lt;br /&gt;
		case 7:&lt;br /&gt;
			return 0x07;&lt;br /&gt;
			break;&lt;br /&gt;
		case 8:&lt;br /&gt;
			return 0x7F;&lt;br /&gt;
			break;&lt;br /&gt;
		case 9:&lt;br /&gt;
			return 0x6F;&lt;br /&gt;
			break;&lt;br /&gt;
		default:&lt;br /&gt;
			return 0;&lt;br /&gt;
			break;&lt;br /&gt;
	}}&lt;br /&gt;
&lt;br /&gt;
void Print_Temp(){&lt;br /&gt;
&lt;br /&gt;
	PORTB = ~(Num_to_code(lsd-48));&lt;br /&gt;
	bit_clear(PORTB, BIT(7));&lt;br /&gt;
	_delay_us(20);&lt;br /&gt;
	bit_set(PORTB, BIT(7));&lt;br /&gt;
&lt;br /&gt;
	_delay_us(50);&lt;br /&gt;
&lt;br /&gt;
	PORTB =( ~(Num_to_code(msd-48)) &amp;amp; 0b01111111);&lt;br /&gt;
//	bit_clear(PORTB, BIT(7));&lt;br /&gt;
&lt;br /&gt;
	bit_set(PORTC,BIT(0)); //turn on MSD common anode&lt;br /&gt;
	_delay_us(30);&lt;br /&gt;
	bit_clear(PORTC,BIT(0)); //turn off MSD common anode&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Clock_Setup(void){&lt;br /&gt;
	CLKPR = 0b10000000;&lt;br /&gt;
	CLKPR = 0x00;&lt;br /&gt;
	//turn off clock /8 so clock is 8Mhz&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Port_Setup(void){&lt;br /&gt;
	PIND = (1&amp;lt;&amp;lt;DDD3)|(1&amp;lt;&amp;lt;DDD2);&lt;br /&gt;
	DDRD= (IN&amp;lt;&amp;lt;DDD3)|(IN&amp;lt;&amp;lt;DDD2)|(OUT&amp;lt;&amp;lt;DDD1)|(IN&amp;lt;&amp;lt;DDD0);&lt;br /&gt;
	bit_set(PORTD,BIT(2));&lt;br /&gt;
	bit_set(PORTD,BIT(3));&lt;br /&gt;
	DDRB=0xFF;&lt;br /&gt;
	DDRC |=  (OUT&amp;lt;&amp;lt;DDC1)|(OUT&amp;lt;&amp;lt;DDC0);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void USART0_Setup(void){&lt;br /&gt;
	UCSR0A = (0 &amp;lt;&amp;lt; U2X0);		//usart double speed&lt;br /&gt;
	UCSR0B = (1 &amp;lt;&amp;lt; RXCIE0)|(0 &amp;lt;&amp;lt; TXCIE0)|(1 &amp;lt;&amp;lt; RXEN0) | (1 &amp;lt;&amp;lt;TXEN0); //rx/tx on. rx/tx ints enabled&lt;br /&gt;
	UCSR0C = (0 &amp;lt;&amp;lt; UCSZ02)|(1 &amp;lt;&amp;lt; UCSZ01)|(1 &amp;lt;&amp;lt; UCSZ00);  //8bit USART&lt;br /&gt;
	UBRR0L = 51;&lt;br /&gt;
	UBRR0H = 0; &lt;br /&gt;
	&lt;br /&gt;
	// the above is for 9600 baud with a clock of 8Mhz&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Timer1_Setup(void){&lt;br /&gt;
	TCNT1=0xE17C;&lt;br /&gt;
	TCCR1B=(1&amp;lt;&amp;lt;CS12)|(0&amp;lt;&amp;lt;CS11)|(1&amp;lt;&amp;lt;CS10);&lt;br /&gt;
	TIMSK1=(1&amp;lt;&amp;lt;TOIE1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(void){&lt;br /&gt;
	Clock_Setup();&lt;br /&gt;
	Port_Setup();&lt;br /&gt;
	USART0_Setup();&lt;br /&gt;
	Timer1_Setup();&lt;br /&gt;
	sei();&lt;br /&gt;
	for(;;){&lt;br /&gt;
		Print_Temp();&lt;br /&gt;
		if(letter_waiting==1){&lt;br /&gt;
			/*&lt;br /&gt;
			State 0 means unkown, bootup&lt;br /&gt;
			state 1 means the device is idle, disconnected&lt;br /&gt;
			state 2 sets the device to connect to the webserver&lt;br /&gt;
			state 3 means the device is connected to the webserver&lt;br /&gt;
			state 4 sets the device to issue a GET command&lt;br /&gt;
			state 5 means the device is waiting for a responce to the GET&lt;br /&gt;
			state 6 means the device has gotten a responce to the GET and is idle, waiting to get a d/c char&lt;br /&gt;
			*/&lt;br /&gt;
			switch (state){&lt;br /&gt;
				case 0:&lt;br /&gt;
					if(last_received_char==&amp;#039;D&amp;#039;){&lt;br /&gt;
						state=1;&lt;br /&gt;
					}&lt;br /&gt;
					letter_waiting=1;&lt;br /&gt;
					bit_clear(PORTD,BIT(2));&lt;br /&gt;
					break;&lt;br /&gt;
				case 1:&lt;br /&gt;
					state=2;&lt;br /&gt;
					//device is idle here, disconnected&lt;br /&gt;
					break;&lt;br /&gt;
				case 2:&lt;br /&gt;
					Matchport_Connect();&lt;br /&gt;
					state=3;&lt;br /&gt;
					break;&lt;br /&gt;
				case 3:&lt;br /&gt;
					//device is connected to the webserver here&lt;br /&gt;
					if(last_received_char==&amp;#039;C&amp;#039;){&lt;br /&gt;
						state=4;&lt;br /&gt;
					}&lt;br /&gt;
					break;&lt;br /&gt;
				case 4:&lt;br /&gt;
					Matchport_GET();&lt;br /&gt;
					bit_clear(PORTD,BIT(3));&lt;br /&gt;
					state=5;&lt;br /&gt;
				case 5:&lt;br /&gt;
					/*&lt;br /&gt;
					parse 0 means nothing of intrest&lt;br /&gt;
					parse 1 was T recieved&lt;br /&gt;
					parse 2 was : recieved&lt;br /&gt;
					parse 3 was &amp;lt; recieved&lt;br /&gt;
					parse 4 was first digit&lt;br /&gt;
					*/&lt;br /&gt;
					switch (parse){&lt;br /&gt;
						case 0:&lt;br /&gt;
							if(last_received_char==&amp;#039;T&amp;#039;){&lt;br /&gt;
								parse = 1;&lt;br /&gt;
							}&lt;br /&gt;
							else {&lt;br /&gt;
								parse = 0;&lt;br /&gt;
							}&lt;br /&gt;
							letter_waiting=0;&lt;br /&gt;
							break;&lt;br /&gt;
						case 1:&lt;br /&gt;
							if(last_received_char==&amp;#039;:&amp;#039;){&lt;br /&gt;
								parse = 2;&lt;br /&gt;
							}&lt;br /&gt;
							else {&lt;br /&gt;
								parse = 0;&lt;br /&gt;
							}&lt;br /&gt;
							letter_waiting=0;&lt;br /&gt;
							break;&lt;br /&gt;
						case 2:&lt;br /&gt;
							if(last_received_char==&amp;#039;&amp;lt;&amp;#039;){&lt;br /&gt;
								parse = 3;&lt;br /&gt;
							}&lt;br /&gt;
							else {&lt;br /&gt;
								parse = 0;&lt;br /&gt;
							}&lt;br /&gt;
							letter_waiting=0;&lt;br /&gt;
							break;&lt;br /&gt;
						case 3:&lt;br /&gt;
							if(last_received_char==&amp;#039;e&amp;#039;){&lt;br /&gt;
								parse = 0;&lt;br /&gt;
								//RUN TO ERROR RUTINE HERE&lt;br /&gt;
							}&lt;br /&gt;
							else{ //the most signifigant digit&lt;br /&gt;
								msd=last_received_char;&lt;br /&gt;
								parse = 4;&lt;br /&gt;
							}&lt;br /&gt;
							letter_waiting=0;&lt;br /&gt;
							break;&lt;br /&gt;
						case 4:&lt;br /&gt;
							lsd=last_received_char;&lt;br /&gt;
							parse = 0;&lt;br /&gt;
							state=6;&lt;br /&gt;
							letter_waiting=0;&lt;br /&gt;
							break;&lt;br /&gt;
					}&lt;br /&gt;
					break;&lt;br /&gt;
				case 6:&lt;br /&gt;
					if(last_received_char==&amp;#039;D&amp;#039;){&lt;br /&gt;
						letter_waiting=0;&lt;br /&gt;
					}&lt;br /&gt;
					//the transaction is complete. It can sit here untill its time to lookup again.&lt;br /&gt;
					//switch to case 2 when its time to connect again.&lt;br /&gt;
					break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code uses a state machine to handle the connection process. The current temp is then muxed to a 7 segment display.&lt;br /&gt;
&lt;br /&gt;
=web files=&lt;br /&gt;
This is the php file on my web server which grabs the data from an XML feed of wunderground. And presents it nicely to the micro. &lt;br /&gt;
&lt;br /&gt;
[http://pauljmac.com/clearwater.php http://pauljmac.com/clearwater.php]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$url =&lt;br /&gt;
&amp;quot;http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=Clearwater,FL&amp;quot;;&lt;br /&gt;
$xml = @simplexml_load_file($url);&lt;br /&gt;
if ($xml){&lt;br /&gt;
       if ($xml-&amp;gt;display_location-&amp;gt;city != &amp;#039;&amp;#039;){&lt;br /&gt;
echo &amp;quot;T:&amp;lt;&amp;quot;;&lt;br /&gt;
               echo $xml-&amp;gt;temp_f;&lt;br /&gt;
               &lt;br /&gt;
echo&amp;quot;&amp;gt;&amp;quot;;&lt;br /&gt;
       }&lt;br /&gt;
} else {&lt;br /&gt;
	echo &amp;quot;T:&amp;lt;&amp;quot;;&lt;br /&gt;
       echo &amp;quot;e&amp;quot;;&lt;br /&gt;
       echo &amp;quot;&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Photos=&lt;br /&gt;
I used my fireball V90 CNC router to cut the FL out of MDF. &lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:100 0403 (Medium).JPG| Back of the FL &lt;br /&gt;
Image:100 0407 (Medium).JPG| Front&lt;br /&gt;
Image:100 0408 (Medium).JPG| Front with the temp displayed&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Paul</name></author>
	</entry>
</feed>