Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decodedco/accelerometer-library
Library to abstract away motion detection for Arduino + Accelerometer
https://github.com/decodedco/accelerometer-library
Last synced: 16 days ago
JSON representation
Library to abstract away motion detection for Arduino + Accelerometer
- Host: GitHub
- URL: https://github.com/decodedco/accelerometer-library
- Owner: DecodedCo
- Created: 2015-09-29T02:12:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-12T13:28:21.000Z (over 9 years ago)
- Last Synced: 2024-11-19T23:48:09.281Z (3 months ago)
- Language: C++
- Size: 188 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
Simple library to use an accelerometer with an arduino. Make sure the library is in your sketchbook library directory and then restart Arduino
Sample program would be:
```
#include
#include
Accelerometer a(10); //CS pin passed to Constructor
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("ready to go!");
}void loop() {
// processor returns a string of last movement recorded
String output = a.processor();
Serial.println(output);
}
```### Documentation
##### Constructors
* `Accelerometer(int chipSelect);`
* Constructor setting just the chip select pin
* `Accelerometer(int chipSelect, float threshold);`
* Constructor overriding the default threshold
* `Accelerometer(int chipSelect, float threshold, int eventThreshold);`
* Constructor overiding the default threshold and event threshold##### Methods
* `setThreshold(int threshold);`
* Method to set the threshold directly
* `setEventThreshold(int eventThreshold);`
* Method to set the event threshold directly
* `String processor();`
* Method to process the output of the accelerometer