biff - my digital letter box

My letter box at work. The control LED is housed in a protective block of wood in the ceiling of the box, providing a steady source to overcome variations in ambient light. The code now also has a test for when post is picked up to trap smart alecs who like to put their hand in for a few seconds.

The test bed

Mockup letter box with post.

The letter box. LED above, photoresistor bottom, and Arduino with Ethernet shield at the back.
(This arrangement will, when it is debugged, go into my letter box at work.)

Arduino says:

Raw Sensor Values	 Yel: 337
Mapped Sensor Values	 Yel: 337
Sentmail	0
Raw Sensor Values	 Yel: 335
Mapped Sensor Values	 Yel: 335
Sentmail	0
Raw Sensor Values	 Yel: 16
Mapped Sensor Values	 Yel: 16
Sentmail	0
220 ESMTP Sendmail 8.14.2/8.14.2/Debian-2build1; Mon, 22 Jul 2013 15:28:51\
+0200; (No UCE/UBE) logging access from:\ [99.999.99.999]
Sending helo
250 Hello [99.999.99.999], pleased to mee\
t you
Sending From 
250 2.1.0 ... Sender ok
Sending To borrel
250 2.1.5 borrel... Recipient ok
Sending DATA
354 Enter mail, end with "." on a line by itself
Sending email
250 2.0.0 r6MDSpWf013424 Message accepted for delivery
Sending QUIT
221 2.0.0 closing connection

Raw Sensor Values	 Yel: 13
Mapped Sensor Values	 Yel: 13
Sentmail	1
Raw Sensor Values	 Yel: 13
Mapped Sensor Values	 Yel: 13
Sentmail	1
Raw Sensor Values	 Yel: 14
Mapped Sensor Values	 Yel: 14

mutt says:

Date: Mon, 22 Jul 2013 15:20:43 +0200
To: Borrel 
From: Boerre 
Subject: You have snail mail

This is from your letter box. I have something for you.


- Børre Ludvigsen, Mon Jul 22 16:07:53 CEST 2013

Last modified: Sat Aug 31 16:38:10 2013