Skip to content
Snippets Groups Projects
Select Git revision
  • 636ed214b59fbc170e82938ce74f1bbd56e776ba
  • master default protected
2 results

main.cpp

Blame
  • main.cpp 709 B
    #define CONFIG_HEAP_CORRUPTION_DETECTION HEAP_POISONING_LIGHT
    #include <Arduino.h>
    #include "utils.h"
    #include "network.h"
    #include "display.h"
    #include "gameoflife.h"
    
    int noEvolutionTicksLimit = 100;
    int brightnessPercent = 20;
    int gameInterval = 100;
    
    unsigned long lastTick;
    
    void showTitle() {
      char msg[13];
      String titleMsg = "Game of Life";
      titleMsg.toCharArray(msg, 13);
      showMessage(msg);
    }
    
    void setup()
    {
      Serial.begin(115200);
      logLine("", true);
      setupDisplay();
      showTitle();
      setupNetwork();
      clearDisplay();
      setupGameOfLife();
    }
    
    void loop()
    {
      networkLoop();
      if ((millis() - lastTick) >= gameInterval) {
        gameLoop();
        displayLoop();
        lastTick += gameInterval;
      }
    }