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
connected
220 myserver.hiof.no ESMTP Sendmail 8.14.2/8.14.2/Debian-2build1; Mon, 22 Jul 2013 15:28:51\
+0200; (No UCE/UBE) logging access from: mymachine.bb.online.no(OK)-ti0097a380-dh\
cp1926.bb.online.no [99.999.99.999]
Sending helo
250 myserver.hiof.no Hello ti0097a380-dhcp1926.bb.online.no [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 myserver.hiof.no closing connection

disconnected
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:

Return-Path: b@hiof.no
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.

!DSPAM:51ed31ac133225675626326!

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


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