-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreal-main.cpp
More file actions
41 lines (32 loc) · 796 Bytes
/
real-main.cpp
File metadata and controls
41 lines (32 loc) · 796 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
32
33
34
35
36
37
38
39
40
41
// Here's a wirish include:
#include <wirish/wirish.h>
#include "control/Motor.h"
Motor motor = Motor(#pin1, #pin2, #pin3);
void setup(void) {
SerialUSB.println("Starting motor test program");
}
void loop(void) {
SerialUSB.println("Motor test loop");
motor.setPower(0.5f);
delay(2500);
motor.setPower(0f);
delay(2500);
motor.setPower(1.0f);
delay(2500);
}
// Standard libmaple init() and main.
//
// The init() part makes sure your board gets set up correctly. It's
// best to leave that alone unless you know what you're doing. main()
// is the usual "call setup(), then loop() forever", but of course can
// be whatever you want.
__attribute__((constructor)) void premain() {
init();
}
int main(void) {
setup();
while (true) {
loop();
}
return 0;
}