-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·37 lines (33 loc) · 746 Bytes
/
main.cpp
File metadata and controls
executable file
·37 lines (33 loc) · 746 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
#include <iostream>
#include "ThunderborgDriver.hpp"
#include "MotorController.hpp"
#include "chrono"
#include "thread"
int main()
{
ThunderborgDriver thunderborgDriver;
thunderborgDriver.initialize();
MotorController motorController(thunderborgDriver);
char letter;
while (letter != 'q')
{
std::cin >> letter;
if (letter == 'w')
{
motorController.driveForward(10);
}
if (letter == 's')
{
motorController.driveBackwords(10);
}
if (letter == 'a')
{
motorController.performSpin(-10);
}
if (letter == 'd')
{
motorController.performSpin(10);
}
}
return 0;
}