Skip to content

Commit

Permalink
fixed a big error (watchdog)
Browse files Browse the repository at this point in the history
  • Loading branch information
nponsard committed Aug 20, 2018
1 parent 5b638fe commit d78f4b3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 35 deletions.
Binary file modified binaries/game_of_life/game_of_life.bin
Binary file not shown.
71 changes: 36 additions & 35 deletions game_of_life/game_of_life.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ uint8_t grid[80][64] ;
unsigned long time = 0 ;
uint16_t temp = 0 ;
uint16_t pointer[2] = {40, 32};



void setup() {

gb.begin();
for (int x = 0; x < 80; x++) {
for (int y = 0; y < 64; y++) {
grid[x][y] = random(0, 2);
}
}
gb.begin();

}

void loop() {
Expand Down Expand Up @@ -79,7 +82,7 @@ void loop() {
}

}
if (gb.buttons.pressed(BUTTON_HOME)) {
if (gb.buttons.pressed(BUTTON_MENU)) {
Play = false;
uint8_t entry;
if (Emode) {
Expand Down Expand Up @@ -143,37 +146,35 @@ void loop() {
}
}

/*
// debug hud
uint16_t ram = gb.getFreeRam();
uint8_t load = gb.getCpuLoad();
if (load > 85) {
gb.display.setColor(RED);
} else {
gb.display.setColor(LIGHTBLUE);
}
gb.display.fillRect(0, 0, 29, 7);
gb.display.fillRect(43, 0, 40 , 7);
gb.display.setColor(GREEN);
gb.display.fillRect(31, 0, 9 , 7);
gb.display.setColor(WHITE);
gb.display.setCursor(1, 1);
gb.display.setFontSize(1);
gb.display.print("CPU:");
gb.display.print(load);
gb.display.println("%");
gb.display.setCursor(32, 1);
temp = millis() - time ;
gb.display.print(1000 / temp);
time = millis();
gb.display.setCursor(44, 1);
gb.display.print("RAM:");
gb.display.println(ram);
// debug hud
uint16_t ram = gb.getFreeRam();
uint8_t load = gb.getCpuLoad();
if (load > 85) {
gb.display.setColor(RED);
} else {
gb.display.setColor(LIGHTBLUE);
}
/*
gb.display.fillRect(0, 0, 29, 7);
gb.display.fillRect(43, 0, 40 , 7);
gb.display.setColor(GREEN);
gb.display.fillRect(31, 0, 9 , 7);
gb.display.setColor(WHITE);
gb.display.setCursor(1, 1);
gb.display.setFontSize(1);
gb.display.print("CPU:");
gb.display.print(load);
gb.display.println("%");
gb.display.setCursor(32, 1);
temp = millis() - time ;
gb.display.print(1000 / temp);
time = millis();
gb.display.setCursor(44, 1);
gb.display.print("RAM:");
gb.display.println(ram);
*/

}

0 comments on commit d78f4b3

Please sign in to comment.