Skip to content

Commit 6a56050

Browse files
committedOct 10, 2023
Added reflectance array tester
1 parent cd10ea6 commit 6a56050

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed
 

‎cookieMonster/src/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void setup() {
159159
delay(10);
160160
}
161161

162-
Serial.print("Starting panel old grab");
162+
delay(5000);
163163

164164
// Old panel grab
165165
chassis.turnFor(TURNAROUND_ANGLE, TURN_SPEED, true);

‎reflectanceTester/platformio.ini

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; PlatformIO Project Configuration File
2+
;
3+
; Build options: build flags, source filter
4+
; Upload options: custom upload port, speed and extra flags
5+
; Library options: dependencies, extra library storages
6+
; Advanced options: extra scripting
7+
;
8+
; Please visit documentation for the other options and examples
9+
; https://docs.platformio.org/page/projectconf.html
10+
11+
[env:a-star32U4]
12+
platform = atmelavr
13+
board = a-star32U4
14+
framework = arduino
15+
lib_deps = ;you need to have the white space/indent the libraries
16+
https://github.com/CAP1Sup/wpi-32u4-library.git ; Use until main wpi library is updated
17+
wire

‎reflectanceTester/src/main.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <Arduino.h>
2+
#include <Romi32U4.h>
3+
4+
#define L_LINE_FOLLOW_PIN A2
5+
#define R_LINE_FOLLOW_PIN A3
6+
7+
void setup() {
8+
// Setup code here
9+
Serial.begin(9600);
10+
while (!Serial) {
11+
delay(10);
12+
}
13+
14+
pinMode(L_LINE_FOLLOW_PIN, INPUT);
15+
pinMode(R_LINE_FOLLOW_PIN, INPUT);
16+
}
17+
18+
void loop() {
19+
// Repeating code here
20+
Serial.print("Left: ");
21+
Serial.print(analogRead(L_LINE_FOLLOW_PIN));
22+
Serial.print(" Right: ");
23+
Serial.println(analogRead(R_LINE_FOLLOW_PIN));
24+
}

0 commit comments

Comments
 (0)
Please sign in to comment.