Sensor signal debouncing
First Claim
1. A method comprising:
- retrieving a present sensor reading;
incrementing a reading change counter and setting a stable reading counter to a predetermined value in response to the present sensor reading not equaling an immediately previous sensor reading;
reporting a sensor reading bouncing error and resetting the reading change counter to a predetermined value in response to the reading change counter being greater than or equal to a reading change tolerance;
incrementing said stable reading counter in response to the present sensor reading equaling the immediately previous sensor reading;
resetting said stable reading counter and reading change counter to a predetermined value in response to said stable reading counter being greater than or equal to a stable reading tolerance;
reporting a state change event and setting said most-recent stable sensor reading equal to said present sensor reading in response to said present sensor reading not being equal to said most-recent stable sensor reading; and
setting said previous sensor reading to said present sensor reading.
4 Assignments
0 Petitions
Accused Products
Abstract
One disclosed method includes retrieving a sensor reading, incrementing a reading change counter and setting a stable reading counter in response to the sensor reading not equaling an immediately previous sensor reading, reporting a sensor reading bouncing error and resetting the reading change counter in response to the reading change counter being greater than or equal to a reading change tolerance, incrementing the stable reading counter in response to the sensor reading equaling the immediately previous sensor reading, resetting the stable reading counter and reading change counter in response to the stable reading counter being greater than or equal to a stable reading tolerance, reporting a state change event and setting the most-recent stable sensor reading equal to the sensor reading in response to the sensor reading not being equal to the most-recent stable sensor reading, and setting the previous sensor reading to the sensor reading.
-
Citations
21 Claims
-
1. A method comprising:
-
retrieving a present sensor reading; incrementing a reading change counter and setting a stable reading counter to a predetermined value in response to the present sensor reading not equaling an immediately previous sensor reading; reporting a sensor reading bouncing error and resetting the reading change counter to a predetermined value in response to the reading change counter being greater than or equal to a reading change tolerance; incrementing said stable reading counter in response to the present sensor reading equaling the immediately previous sensor reading; resetting said stable reading counter and reading change counter to a predetermined value in response to said stable reading counter being greater than or equal to a stable reading tolerance; reporting a state change event and setting said most-recent stable sensor reading equal to said present sensor reading in response to said present sensor reading not being equal to said most-recent stable sensor reading; and setting said previous sensor reading to said present sensor reading. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method comprising:
-
retrieving a present sensor reading; determining if the present sensor reading equals an immediately previous sensor reading; incrementing a reading change counter and setting a stable reading counter to a predetermined value in response to the present sensor reading not equaling an immediately previous sensor reading; determining if a change in the reading change counter is greater than or equal to a reading change tolerance; reporting a sensor reading bouncing error and resetting the reading change counter to a predetermined value in response to the reading change counter being greater than or equal to a reading change tolerance; incrementing said stable reading counter in response to the present sensor reading equaling the immediately previous sensor reading; determining if a change in said stable reading counter is greater than or equal to a stable reading tolerance; resetting said stable reading counter and reading change counter to a predetermined value in response to said stable reading counter being greater than or equal to a stable reading tolerance; determining if said present sensor reading is not equal to said most-recent stable sensor reading; reporting a state change event and setting said most-recent stable sensor reading equal to said present sensor reading in response to said present sensor reading not being equal to said most-recent stable sensor reading; and setting said previous sensor reading to said present sensor reading. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A computer program product comprising:
a computer usable medium having computer readable program code means embodied therein for causing a computer to, in iterative fashion; retrieve a sensor reading; determine if said sensor reading represents a changed sensor reading; increment a reading change counter and set a stable reading counter to a predetermined value in response to the sensor reading having changed; determine if a changed sensor reading is indicative of toggling; report a sensor reading bouncing error and reset the reading change counter to a predetermined value in response to the reading change indicating the sensor reading is toggling; increment said stable reading counter in response to the sensor reading having not changed; determine if the unchanged sensor reading is stable; reset said stable reading counter and said reading change counter to a predetermined value in response then unchanged sensor reading being stable; determine if a stable unchanged sensor reading is different from a most-recent stable sensor reading; report a state change event and set said most-recent stable sensor reading to be equal to the stable unchanged sensor reading; and set a previous sensor reading to be equal to said sensor reading. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20)
-
21. A system comprising:
-
means for retrieving a present sensor reading; means for determining if the present sensor reading equals an immediately previous sensor reading; means for incrementing a reading change counter and setting a stable reading counter to a predetermined value in response to the present sensor reading not equaling an immediately previous sensor reading; means for determining if a change in the reading change counter is greater than or equal to a reading change tolerance; means for reporting a sensor reading bouncing error and resetting the reading change counter to a predetermined value in response to the reading change counter being greater than or equal to a reading change tolerance; means for incrementing said stable reading counter in response to the present sensor reading equaling the immediately previous sensor reading; means for determining if a change in said stable reading counter is greater than or equal to a stable reading tolerance; means for resetting said stable reading counter and reading change counter to a predetermined value in response to said stable reading counter being greater than or equal to a stable reading tolerance; means for determining if said present sensor reading is not equal to said most-recent stable sensor reading; means for reporting a state change event and setting said most-recent stable sensor reading equal to said present sensor reading in response to said present sensor reading not being equal to said most-recent stable sensor reading; and means for setting said previous sensor reading to said present sensor reading.
-
Specification