Hi
I have set up a force sensing resistor to pritnln at a certain pressuer
then I want to add the println via software proxy to execute a script.
( the println works) . I want to make it so when some one seats on the sensor the sensor will send a print line once (1time) then will do the same when some alse sits in it again. what I have so far listens and delays ,
then when feels new person on the chair , the print line waits for the time tha is set to delay.
here is my code, hope you guys will be able to help me out.
thank you for all you help , is helping me to learn.
/* forcesengin resistor send print line
* ------------------
*forcensing @ pin 0 analog
* 1k resistor ground-analog 0
* other resistor leg goes to 5volts
* serial print
* uncoment val to see values on serial print
*
*
*
*
*/
int fPin = 0; // input pin for force sening rr
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
// Serial.flush();
// pinMode(lPin, OUTPUT); // declare the ledPin as an OUTPUT
}
void loop() {
val = analogRead(fPin); // read the value from the sensor
Serial.println(val);
// delay(200);
if (analogRead(fPin) >= 320 && analogRead(fPin) <= 700 )
Serial.println("A");
//delay(10000);
Serial.flush();
delay(10000);
Serial.flush();
}