Arduino powered DRO for my Mini Mill

I was thinking, all that arduino power can do so much more than only counting and showing ...

I have some thoughts on the housing for the screen and zero buttons.
because the workshop is a dirty place, i'm going to put the LCD behind a piece off (acrylic)glass in a closed housing.

I want to put CNY 70 Vishay under the screen and also behind the glass, the idea is that when I put my finger on the glass the CNY 70 zeros the counts.

I'm not an electronic engineer so i don't have any idea if this works, someone an idea, or a better component that does the job even better?

I don't know for sure, but i seriously doubt that would work.
Reason is the sensor consists of an IR LED and an IR receiver.
That's a light source and you seem to be planning to have it light a spot on a reflective surface.

Maybe, if you put it right up against the glass, you might be able to get it to work, but as you can see the component housing has some edge and a reflective surface itself.
That will probably cause some interesting effects.

Tanks everyone, got it to work.
I added some Capsens zero "bolt-buttons"

now making a nice housing for it, i'll show it when its done

I almost forgot I still have to make the RPM code.
I used all the interupts for the DRO. I'm now wondering if the DRO leaves enough time (cycle-time) for reading and processing 2500RPM
and not miss any encoder pulses.

I don't have any interrupts left so i went looking for an other way.
I found an interesting chapter in my cookbook on timers.

I tried the following code on an arduino uno:

int count;
int getCount()
{
TCCR1B= 0;
count = TCNT1;
TCNT1 = 0;

bitSet(TCCR1B ,CS12);
bitSet(TCCR1B ,CS11);
bitSet(TCCR1B ,CS10);

return count;
}

void setup()
{
Serial.begin(9600);
digitalWrite(5, HIGH);
TCCR1A= 0;
getCount();
}

void loop()
{
delay(1000);
Serial.println(getCount());
}

This code counts the number of pulses on pin5 during 1000ms, multiplying that by 60 gives me RPM.
I tried to get it integrated on my original code but it unfortunately i cant get it to work.

Original code without RPM:
Arduino_Powered_DRO_04_10_2013

New code, RPM integrated (doesn't work)
Arduino_Powered_DRO_16_10_2013
(I changed TCCR1B into TCCR5B and TCCR1A into TCCR5A because I used an Mega)