Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Slide 10 Slide 11 Slide 12 Slide 13 Slide 14 Slide 15 Slide 16 Slide 17 Slide 18 Slide 19 Slide 20 Slide 21 Slide 22 Slide 23 Slide 24 Slide 25 Slide 26 Slide 27 Slide 28 Slide 29 Slide 30 Slide 31 Slide 32 Product List
mTouch-Slide30

Implementing this in a software routine on a TMR0 interrupt, the current data is read into the raw variable. If the average value minus the trip value is greater than the raw value, a sensor touch has occurred and the software responds accordingly. Otherwise, the sensor is determined to be untouched and the current value in TMR1 registers is averaged into the 16-point running average. The TMR1 registers are always cleared at the end of every TMR0 interrupt routine and the CPU returns to whatever it was doing prior to the interrupt, thus completing the basic system.

PTM Published on: 2011-10-28