-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtestMode.cpp
More file actions
31 lines (28 loc) · 867 Bytes
/
testMode.cpp
File metadata and controls
31 lines (28 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* Flybrix Flight Controller -- Copyright 2018 Flying Selfie Inc. d/b/a Flybrix
*
* http://www.flybrix.com
*/
#include "Arduino.h"
#include "led.h"
#include "state.h"
#include "command.h"
#include "controlVectors.h"
void runTestRoutine(State& state, LED& led, PilotCommand& pilot, size_t led_id, size_t motor_id) {
pilot.resetMotors();
pilot.setMotor(motor_id, 500);
pilot.applyControl(ControlVectors());
}
void runTestMode(State& state, LED& led, PilotCommand& pilot) {
pilot.override(true);
size_t led_id{0};
size_t motor_id{0};
led.setWhite(board::led::Position::Min(), board::led::Position::Max(), true, true, 250);
led.update();
while (true) {
runTestRoutine(state, led, pilot, led_id, motor_id);
led_id = (led_id + 1) % 4;
motor_id = (motor_id + 1) % 8;
delay(300);
}
}