Unfamiliar Code Errors

I've been working on a code meant to imitate a stop watch but keep running into many errors. I was hoping someone could look over the code I have now and see if you could help solve my issues?

int start_time;
int lap_time;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while (!Serial);
pinMode(4,INPUT_PULL_DOWN);
PinMode(5, INPUT_PULL_DOWN);
pinMode(13, OUTPUT);
attachInterrupt(digitalPinToInterrupt(4), strstp, RISING);
attachInterrupt(digitalPinToInterrupt(5), lap, RISING);
start_time = 0;
digitalWrite(13, Low);

void strstp() {
if (start_time == 0)
{
start_time = Millis();
lap_time = start_time;
digitalWrite(13, high);

else
{
int curr = millis();
if ((cur - start_time) < 100)
{
return;
}
serial.print("Lap: ");
serial.print(((double)(curr - lap_time))/1000);
serial.print("s, Total Time: ");
serial.print(((double)(curr - start_time))/1000);
serial.println("s");
DigitalWrite(13, LOW);
stat_time = 0;
lap_time = 0;
}
}

void lap() {
if (start_time != 0)
{
int curr = mills();
if((curr - lap_time) < 100)
{
retrun;
}
Serial.print(((double)(curr - lap_time))/1000)
Serial.println("s");
lap_time = curr;
}
}

Please remember to use code tags when posting code.

And the errors were...?
(Lack of loop ? INPUT_PULL_DOWN ?"retrun", "Low", missing }, Millis)

I was hoping someone could look over the code I have now and see if you could help solve my issues?

It would help to know what issues you are having.

At first pass I think I'd make these.

int start_time;
int lap_time;

Into unsigned long variables.

-jim lee

Try changing "serial." into "Serial."

and close setup(), and also add loop()

If you post your code as described in the how to use this forum sticky, more forum members will read it.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.