Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Arduino API #21

Merged
merged 8 commits into from
Jun 21, 2021
Merged

Support Arduino API #21

merged 8 commits into from
Jun 21, 2021

Conversation

hathach
Copy link
Member

@hathach hathach commented Jun 9, 2021

This PR add Arduino compatible API as https://github.com/arduino-libraries/Arduino_LSM6DSOX/blob/master/src/LSM6DSOX.h#L34

This allow for sketch that run on arduino sensonr/platform can be easily migrated to use with Adafruit Sensor (e.g https://experiments.withgoogle.com/tiny-motion-trainer)

  // Arduino compatible API
  int readAcceleration(float &x, float &y, float &z);
  float accelerationSampleRate(void);
  int accelerationAvailable(void);

  int readGyroscope(float &x, float &y, float &z);
  float gyroscopeSampleRate(void);
  int gyroscopeAvailable(void);

PS: written fashion that requires adafruit/Adafruit_BusIO#46, therefore this is submitted as draft for now

@hathach hathach requested a review from ladyada June 9, 2021 10:12
Adafruit_LSM6DS.cpp Outdated Show resolved Hide resolved
Adafruit_LSM6DS.cpp Outdated Show resolved Hide resolved
@hathach hathach marked this pull request as ready for review June 21, 2021 05:20
@hathach hathach requested a review from ladyada June 21, 2021 07:58
@hathach
Copy link
Member Author

hathach commented Jun 21, 2021

thank you for your review

@hathach hathach merged commit 254ad8d into master Jun 21, 2021
eringerli added a commit to eringerli/Adafruit_LSM6DS that referenced this pull request May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants