   ratio = 0;
 
   lastmillis = 0;
+  
+    Serial.print("Initializing SD card...");
+  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
+  // Note that even if it's not used as the CS pin, the hardware SS pin 
+  // (10 on most Arduino boards, 53 on the Mega) must be left as an output 
+  // or the SD library functions will not work. 
+  pinMode(10, OUTPUT);
+ 
+  if (!SD.begin(10)) {
+    Serial.println("initialization failed!");
+    return;
+  }
+  Serial.println("initialization done.");
+ 
+  // open the file. note that only one file can be open at a time,
+  // so you have to close this one before opening another.
+  file = SD.open("data.log", FILE_WRITE);
 }
 
 /**


unsigned long lastmillis;

void setup() {
  Serial.begin(9600);


  }
  
}

void writeToFile(char* data) {
  if (file) {
    file.println(data);
  }
}

void rpm_counter() {
  engine_pulses++;
}
