Currently a giant piece of crap, this library is just a quick way to get cheap inputs out of scrap parts. I will fix it up eventually so if you decide to use it now you do so at your own risk. Also, if you are allergic to moronic library names you probably do not want to touch this :)

theBadTouch.h

Committer:
Nakor
Date:
2011-02-03
Revision:
5:e1e14d61dd00
Parent:
1:69d0b1c11c73

File content as of revision 5:e1e14d61dd00:

/* This is a touch sensing library.  If you don't have any buttons lying around but need
 * user input, you may still have what you need.  A few capacitors, resistors, unused pins,
 * and some wire and you've got yourself some capacitive input.
 *
 * This library (theBadTouch) by Aaron Goselin.  You are free to do what you like with this,
 * but please keep credit in place.
 * 2010 Aaron Goselin.
 *
 */

#ifndef _TOUCHYMCTOUCHERTON_
#define _TOUCHYMCTOUCHERTON_

#include "mbed.h"


class theBadTouch {

public:


    theBadTouch(PinName touchPin, PinName sink);
    

    float badPlace();
    char isTouch();

protected:
    DigitalIn * _sink;
    DigitalInOut * _precharge;
    AnalogIn * _sense;
    PinName _sensor;
    bool tracker1, tracker2;
    Timer t, t_off;
    char _touchFlag, _untouchedFlag;
    int falseCounter;
    char _touchCounter;
    

    
};

#endif