Skip to content

map write read BugFix #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions uROS_STEP12_micromouse/SPIFFS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ void mapWrite(void)
Serial.println("- failed to open file for writing");
return;
}
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int i = 0; i < MAZESIZE_X; i++) {
for (int j = 0; j < MAZESIZE_Y; j++) {
data_temp = g_map_control.getWallData(i, j, north) +
(g_map_control.getWallData(i, j, east) << 2) +
(g_map_control.getWallData(i, j, south) << 4) +
Expand Down Expand Up @@ -63,8 +63,8 @@ void copyMap(void)
Serial.println("- failed to open file for reading");
return;
}
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int i = 0; i < MAZESIZE_X; i++) {
for (int j = 0; j < MAZESIZE_Y; j++) {
if (file.available()) {
read_data = file.read();
g_map_control.setWallData(i, j, north, read_data & 0x03);
Expand Down
2 changes: 1 addition & 1 deletion uROS_STEP2_SWITCH/uROS_STEP2_SWITCH.ino
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void loop()
}
if (digitalRead(SW_C) == 0) {
digitalWrite(LED2, (++g_state_c) & 0x01);
digitalWrite(LED1, (g_state_c)&0x01);
digitalWrite(LED1, g_state_c & 0x01);
}
if (digitalRead(SW_L) == 0) {
digitalWrite(LED0, (++g_state_l) & 0x01);
Expand Down
8 changes: 4 additions & 4 deletions uROS_STEP8_micromouse/SPIFFS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ void mapWrite(void)
Serial.println("- failed to open file for writing");
return;
}
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int i = 0; i < MAZESIZE_X; i++) {
for (int j = 0; j < MAZESIZE_Y; j++) {
data_temp = g_map_control.getWallData(i, j, north) +
(g_map_control.getWallData(i, j, east) << 2) +
(g_map_control.getWallData(i, j, south) << 4) +
Expand Down Expand Up @@ -63,8 +63,8 @@ void copyMap(void)
Serial.println("- failed to open file for reading");
return;
}
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int i = 0; i < MAZESIZE_X; i++) {
for (int j = 0; j < MAZESIZE_Y; j++) {
if (file.available()) {
read_data = file.read();
g_map_control.setWallData(i, j, north, read_data & 0x03);
Expand Down