Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dxinteractive authored Jun 28, 2016
1 parent bd52bbd commit 621ea0d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,24 @@ The source files are also heavily commented, so check those out if you want fine
Here's a basic example:

```Arduino
// include the ResponsiveAnalogRead library
#include <ResponsiveAnalogRead.h>
// define the pin you want to use
const int ANALOG_PIN = A0;
// make a ResponsiveAnalogRead object, pass in the pin, and either true or false depending on if you want sleep enabled
// enabling sleep will cause values to take less time to stop changing and potentially stop changing more abruptly,
// where as disabling sleep will cause values to ease into their correct position smoothly
ResponsiveAnalogRead analog(ANALOG_PIN, true);
// the next optional argument is snapMultiplier, which is set to 0.01 by default
// you can pass it 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 if sleep is not enabled
void setup() {
// begin serial so we can see analog read values through the serial monitor
Serial.begin(9600);
}
Expand All @@ -50,14 +62,20 @@ void loop() {
}
```

##Methods for usage
##Constructor arguments

- `pin` - int, the pin to read (e.g. A0)
- `sleepEnable` - boolean, sets whether sleep is enabled. Defaults to true. Enabling sleep will cause values to take less time to stop changing and potentially stop changing more abruptly, where as disabling sleep will cause values to ease into their correct position smoothly.
- `snapMultiplier` - float, a value from 0 to 1 that controls the amount of easing. Defaults to 0.01. 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 if sleep is not enabled.

##Basic methods

- `int getValue() // get the responsive value from last update`
- `int getRawValue() // get the raw analogRead() value from last update`
- `bool hasChanged() // returns true if the responsive value has changed during the last update`
- `void update(); // updates the value by performing an analogRead() and calculating a responsive value based off it`

##Settings
##Other methods (settings)

###Sleep

Expand Down

0 comments on commit 621ea0d

Please sign in to comment.