1 //TOUCH SENSING BETA - LED TURNS ON WHEN LIGHT IS PRESENT
2 //BY: RICARDO DE LEMOS 1/17/2007
4 int cath = 2; // negative
5 int ando = 3; // positive
10 pinMode(cath, OUTPUT);
11 pinMode(ando, OUTPUT);
22 pinMode(ando, OUTPUT);
24 digitalWrite(cath, LOW);
25 digitalWrite(ando, HIGH);
29 //REVERSE BIAS + CHARGE LED
30 digitalWrite(cath, HIGH);
31 digitalWrite(ando, LOW);
37 int state = digitalRead(ando);
40 if((state != last) && state == LOW) shine = !shine;
45 digitalWrite(led1,HIGH);
47 digitalWrite(led1,LOW);