Skip to content

Commit 6d253c4

Browse files
Update description for v1.1
1 parent 4ca740f commit 6d253c4

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ ResponsiveAnalogRead is an Arduino library for eliminating noise in analogRead i
88
3. Have the option to be responsive when a voltage *stops* changing - when enabled the values returned must stop changing almost immediately after.
99
4. The returned values must avoid 'jumping' up several numbers at once, especially when the input signal changes very slowly. It's better to transition smoothly as long as that smooth transition is short.
1010

11-
You can preview the way the algorithm works with [sleep enabled](http://codepen.io/dxinteractive/pen/KzGegy) (minimising the time spend transitioning between values) and with [sleep disabled](http://codepen.io/dxinteractive/pen/ezdJxL) (transitioning responsively but smooth).
11+
You can preview the way the algorithm works with [sleep enabled](http://codepen.io/dxinteractive/pen/zBEbpP) (minimising the time spend transitioning between values) and with [sleep disabled](http://codepen.io/dxinteractive/pen/ezdJxL) (transitioning responsively but smooth).
1212

1313
An article discussing the design of the algorithm can be found [here](http://damienclarke.me/code/posts/writing-a-better-noise-reducing-analogread).
1414

15-
###Impending version bump
16-
Written 14/07/2016
17-
18-
Improvements to the sleep algorithm will be pushed as a minor version upgrade soon. Special thanks to /u/brontide for the assistance.
19-
2015
##How to install
2116

2217
In the Arduino IDE, go to Sketch > Include libraries > Manage libraries, and search for ResponsiveAnalogInput.
@@ -38,7 +33,7 @@ const int ANALOG_PIN = A0;
3833
3934
// make a ResponsiveAnalogRead object, pass in the pin, and either true or false depending on if you want sleep enabled
4035
// enabling sleep will cause values to take less time to stop changing and potentially stop changing more abruptly,
41-
// where as disabling sleep will cause values to ease into their correct position smoothly
36+
// where as disabling sleep will cause values to ease into their correct position smoothly and with slightly greater accuracy
4237
ResponsiveAnalogRead analog(ANALOG_PIN, true);
4338
4439
// the next optional argument is snapMultiplier, which is set to 0.01 by default
@@ -81,6 +76,8 @@ void loop() {
8176
- `int getRawValue() // get the raw analogRead() value from last update`
8277
- `bool hasChanged() // returns true if the responsive value has changed during the last update`
8378
- `void update(); // updates the value by performing an analogRead() and calculating a responsive value based off it`
79+
- `void update(int rawValue); // updates the value by accepting a raw value and calculating a responsive value based off it (version 1.1.0+)`
80+
- `bool isSleeping() // returns true if the algorithm is in sleep mode (version 1.1.0+)`
8481

8582
##Other methods (settings)
8683

@@ -98,9 +95,8 @@ Sleep allows you to minimise the amount of responsive value changes over time. I
9895

9996
It's behaviour can be modified with the following methods:
10097
- `void enableEdgeSnap() // edge snap ensures that values at the edges of the spectrum (0 and 1023) can be easily reached when sleep is enabled`
101-
- `void setSleepDelay(unsigned int ms) // sets the amount of time before sleeping`
102-
- `void setSleepActivityThreshold(unsigned int newThreshold) // the amount of movement that must take place while asleep for it to register as activity and start moving the output value. Defaults to 20.`
103-
- `void setAwakeActivityThreshold(unsigned int newThreshold) // the amount of movement that must take place while awake for it to register as activity, and reset the timer before sleep occurs. Defaults to 5.`
98+
- `void setSleepDelay(int ms) // sets the amount of time before sleeping`
99+
- `void setActivityThreshold(float newThreshold) // the amount of movement that must take place for it to register as activity and start moving the output value. Defaults to 4.0. (version 1.1+)`
104100

105101
###Snap multiplier
106102

@@ -109,7 +105,7 @@ It's behaviour can be modified with the following methods:
109105
SnapMultiplier is a value from 0 to 1 that controls the amount of easing. Increase this to lessen the amount of easing (such as 0.1) and make the responsive values more responsive, but doing so may cause more noise to seep through when sleep is not enabled.
110106

111107
###Analog resolution
112-
- `void setAnalogResolution(unsigned int resolution)`
108+
- `void setAnalogResolution(int resolution)`
113109

114110
If your ADC is something other than 10bit (1024), set that using this.
115111

0 commit comments

Comments
 (0)