I need a project for a race timer

hey all arduino geeks and all other arduino fans, do you know of any race timers like when a bean gets broken (ir laser or something else) it starts and when it gets broken again it stops and shows you how long the laser was broken for. and extra would be nice but not needed, for like the fist 2secs it douse not listen to the bean that will be broken so if you have a runner and the front leg brakes the beam the back leg douse not stop the timer. i need a program and instructions.

You can use a laser (red) for the "trip" wire aiming onto a photodiode. As far as timer goes, look into the timer library and I'm sure it'd help you to trigger an event or timed action.

I have been doing this with lasers and LDRs for timing electric mini dragsters (timing a few seconds accurately and i works surprisingly well)

The code is pretty simple although mine is more complex cos I added in loads of un-needed stuff.

Before you ask, no I am not going to post my whole code…

I recommend you look into millis() for getting time data and using while(sensor == HIGH){} to wait for beam to be broken.

Basically:
wait for beam
read millis()
wait for beam
take previous millis() away from current millis()
display time

Simple :slight_smile:

Mowcius

why ant you post your code? i reallly wont it

why ant you post your code? i reallly wont it

Cos for one thing it wouldn't fit on a post (or 5 probably) as it is about 800 lines long.

Also I am not a fan of just giving away all of my code when people should just do some searching and they would find that most of the stuff is easy to find online.

My code also includes a lot of other stuff that you don't need and it would no doubt be confusing.

I practically told you what to do in my last post anyway.

Mowcius

my dad know a lot about c he wrote a whole program for his work can you email it to me?

Are you actually serious, or are you just trying to wind mowcius up?

Andrew

my dad know a lot about c he wrote a whole program for his work can you email it to me?

Sorry but the answer's still no. It wouldn't help you. Here is a section for the timing part:

while(digitalRead(sensor1) == HIGH){}; 
  starttime = micros();
  digitalWrite(laser1, LOW);
  while(digitalRead(sensor2) == HIGH){};
  endtime = micros();
  digitalWrite(laser2, LOW);
  time = (endtime-starttime)/1000;

Probably the latter

Mowcius

i am serious. i am not kidding. you want my email?

please i really need the code

He gave it you in reply #7. Seriously, all you need is about another ten or fifteen lines and you've got a workable timer.

ya but i wont his code to see what goodies he packed in

Goodies come later, when you've mastered the basics.