Skip to content

Commit 9ebc2c7

Browse files
committed
Fixed WPI Romi library issues
1 parent 4e4b900 commit 9ebc2c7

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@
3636

3737
# VSCode
3838
*.vscode
39+
40+
# Platformio autogenerated files
41+
*.gitignore

homework1/platformio.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
platform = atmelavr
1313
board = a-star32U4
1414
framework = arduino
15+
lib_ldf_mode = chain+
1516
lib_deps = ;you need to have the white space/indent the libraries
16-
wpi-32u4-library
17+
https://github.com/CAP1Sup/wpi-32u4-library.git
1718
wire

homework1/src/main.cpp

+29-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
1+
/**
2+
* Demonstration of controlling two servos simultanesouly. See documentation for
3+
* servo.h/.cpp for more details.
4+
*
5+
* */
6+
17
#include <Arduino.h>
8+
#include <Chassis.h>
29
#include <wpi-32u4-lib.h>
310

4-
void setup()
5-
{
6-
// Setup code here
11+
// Declare a chassis object with nominal dimensions
12+
// In practice, adjust the parameters: wheel diam, encoder counts, wheel track
13+
Chassis chassis(7.0, 1440, 14.9);
14+
15+
/*
16+
* This is the standard setup function that is called when the board is rebooted
17+
* It is used to initialize anything that needs to be done once.
18+
*/
19+
void setup() {
20+
// initialize the chassis (which also initializes the motors)
21+
chassis.init();
22+
chassis.idle();
23+
24+
// these can be undone for the student to adjust
25+
//chassis.setMotorPIDcoeffs(5, 0.5);
726
}
827

9-
void loop()
10-
{
11-
// Repeating code here
12-
}
28+
/*
29+
* The main loop for the program. The loop function is repeatedly called
30+
* after setup() is complete.
31+
*/
32+
void loop() {
33+
34+
}

0 commit comments

Comments
 (0)