al final lo hice así:
volatile int contador = 0;
volatile int conta = 0;
byte temp=0;
int OutPin7 = 7;
int OutPin9 = 9;
unsigned long tiempo1 = 0; //guarda tiempo de referencia para comparar
unsigned long tiempo2 = 0; //guarda el tiempo que resta por contar cuando presionamos la pausa
unsigned long segundos1;//microsegundos
float segundos2;//segundos
float hora;
float metros=0.0675;
float km=0.0000675;
float metrosegundo;
float kmhora;
float kmhora2;
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
//--------------------------------------------------------------
void setup() {
lcd.init();
lcd.backlight();
pinMode(OutPin7, OUTPUT);
digitalWrite(OutPin7, HIGH);
pinMode(OutPin9, OUTPUT);
digitalWrite(OutPin9, HIGH);
Serial.begin(9600);
attachInterrupt(1,interrupcion1,RISING); // Interrupcion 0 (pin3)
attachInterrupt(0,interrupcion0,RISING); // Interrupcion 0 (pin2)
// LOW, CHANGE, RISING, FALLING
lcd.setCursor(0,0);
lcd.print(" Mide velocidad");
lcd.setCursor(2,1);
lcd.print("(m/s y Km/h)");
delay(2000);
lcd.clear();
}
//-----------------------------------------------------------------------------------
void loop() {
delay(1000); // retardo de casi 1 segundo
if (conta==1){
}
if(contador==1){
// contador=0;
}
if ((conta==1) && (contador==1)){
segundos1=tiempo2-tiempo1;
segundos2=(float)segundos1/1000000;
hora=segundos2/3600;
metrosegundo=metros/segundos2;
kmhora=metrosegundo/1000;
kmhora2=kmhora*3600;
}
//Serial.print(segundos1);
//Serial.println(" microsegundos");
//Serial.print(segundos2,6);
//Serial.println(" segundos");
lcd.setCursor(0,0);
lcd.print(" m/s Km/h");
lcd.setCursor(2,1);
lcd.print(metrosegundo);
lcd.setCursor(9,1);
lcd.print(kmhora2);
}
//----------------------------------------------------------------------------------
void interrupcion1() // Funcion que se ejecuta durante cada interrupion
{
tiempo1=micros();
conta=0;
conta++; // Se incrementa en uno el contador
}
void interrupcion0() // Funcion que se ejecuta durante cada interrupion
{
tiempo2=micros();
contador=0;
contador++; // Se incrementa en uno el contador
}
ya le metí la pantalla y tal,