Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "CurieIMU.h"
- long lastStepCount = 0; // переменная для хранения количества шагов
- void setup() {
- Serial.begin(9600);
- CurieIMU.begin(); // инициализация шагомера
- CurieIMU.setStepDetectionMode(CURIE_IMU_STEP_MODE_NORMAL);
- CurieIMU.setStepCountEnabled(true);
- }
- void loop() {
- int stepCount = CurieIMU.getStepCount(); // получение количества шагов
- if (stepCount != lastStepCount) {
- Serial.print("Step count: ");
- Serial.println(stepCount);
- lastStepCount = stepCount;
- }
- delay(1000);
- }
Add Comment
Please, Sign In to add comment