Fast Switch on/off counts

In case anybody is looking for fast switch on/off counts, you can remove the resistor before the input pin , so the sensitivity is higher. One resistor strategy.

Also, use this style code. Together, the accuracy and speed are awesome.

temp=digitalRead(getStep);
if(temp!=digitalRead(getStep)){
count++;
Serial.println(count);
}

Before I found this, I used the normal switch connection ( with two resistors ) to try my pedometer for half a day, the performance was very pool. Solder and re-solder, did not solve the problem. Arduino almost could not get accurate reading.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: