   
   }
    TV.select_font(font6x8);
+
+  
+  menu();
+
 }
+
+boolean pausado = false;
 
 int speed = 25;
 void loop() {
-
+    
+    if(pausado) {
+      if (digitalRead(2) == HIGH) { 
+        pausado = false;
+        delay(100);
+      }
+      return;
+    }
+    
+    if (digitalRead(2) == HIGH) pausado = true;
+    
+    if (digitalRead(3) == HIGH) {
+      xb = 60;
+      yb = 60;
+      xj1 = 0;
+      xj2 = 0;
+      i = 1;
+      j = 1;
+      ponto2 = 0;
+      ponto1 = 0;
+      speed = 25;
+      menu();
+      return;
+    }
+    
     int a = analogRead(1) + analogRead(1) + analogRead(1);
     delay(1);
     a += analogRead(1) + analogRead(1) + analogRead(1);

int ponto1 = 0;
int ponto2 = 0;

void setup() {
  TV.begin(NTSC,120,96);
  randomSeed(analogRead(0));
  TV.select_font(font4x6);

    
    delay(1);
    b += analogRead(2) + analogRead(2) + analogRead(2);
    
    if(b <= 0) b = 0;
    if(a <= 0) a = 0;
    
    TV.clear_screen();
    TV.println(xb, yb,".");
    TV.println(0, (a/6)/8,"|");
    TV.println(110, (b/6)/8,"|");
    TV.select_font(font4x6);
    TV.println(33, 1, ponto1);
