diff --git a/MSA301-V1.0-ENG.PDF b/MSA301-V1.0-ENG.PDF new file mode 100644 index 0000000..1772747 Binary files /dev/null and b/MSA301-V1.0-ENG.PDF differ diff --git a/examples/plotdemo/plotdemo.ino b/examples/plotdemo/plotdemo.ino new file mode 100644 index 0000000..625b4d4 --- /dev/null +++ b/examples/plotdemo/plotdemo.ino @@ -0,0 +1,37 @@ +// Basic demo for plotting accelerometer readings from Adafruit MSA301 + +#include +#include +#include + +Adafruit_MSA301 msa; + +void setup(void) { + Serial.begin(115200); + while (!Serial) delay(10); // will pause Zero, Leonardo, etc until serial console opens + + Serial.println("Adafruit MSA301 test!"); + + // Try to initialize! + if (! msa.begin()) { + Serial.println("Failed to find MSA301 chip"); + while (1) { delay(10); } + } + Serial.println("MSA301 Found!"); + +} + +void loop() { + + /* Get a new sensor event, normalized */ + sensors_event_t event; + msa.getEvent(&event); + + /* Display the results (acceleration is measured in m/s^2), with commas in between */ + Serial.print(event.acceleration.x); + Serial.print(", "); Serial.print(event.acceleration.y); + Serial.print(", "); Serial.print(event.acceleration.z); + Serial.println(); + + delay(10); +} \ No newline at end of file