Compare commits
6 commits
main
...
Accelerome
Author | SHA1 | Date | |
---|---|---|---|
boutrie.eytan | bc8b071a5a | ||
boutrie.eytan | d7a7796041 | ||
boutrie.eytan | f87d32fda6 | ||
boutrie.eytan | 363dbdd61a | ||
boutrie.eytan | 2033044d41 | ||
boutrie.eytan | 7b01756edc |
|
@ -33,20 +33,16 @@ S20A is 3.3V voltage regulator MIC5205-3.3BM5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "MPU9250.h"
|
#include "MPU9250.h"
|
||||||
#include "AccelStepper.h"
|
|
||||||
|
|
||||||
float biai = 1.25;
|
float biai = 1.25;
|
||||||
|
|
||||||
// an MPU9250 object with the MPU-9250 sensor on I2C bus 0 with address 0x68
|
// an MPU9250 object with the MPU-9250 sensor on I2C bus 0 with address 0x68
|
||||||
MPU9250 IMU(Wire,0x68);
|
MPU9250 IMU(Wire,0x68);
|
||||||
int status;
|
int status;
|
||||||
AccelStepper stepper;
|
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// serial to display data
|
// serial to display data
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
stepper.setMaxSpeed(1700);
|
|
||||||
stepper.setSpeed(1700);
|
|
||||||
while(!Serial) {}
|
while(!Serial) {}
|
||||||
|
|
||||||
// start communication with IMU
|
// start communication with IMU
|
||||||
|
@ -63,7 +59,6 @@ void setup() {
|
||||||
void loop() {
|
void loop() {
|
||||||
// read the sensor
|
// read the sensor
|
||||||
IMU.readSensor();
|
IMU.readSensor();
|
||||||
stepper.runSpeed();
|
|
||||||
// display the data
|
// display the data
|
||||||
Serial.print("AccelX: ");
|
Serial.print("AccelX: ");
|
||||||
Serial.print(IMU.getAccelX_mss(),2);
|
Serial.print(IMU.getAccelX_mss(),2);
|
Loading…
Reference in a new issue