Announcement

Collapse
No announcement yet.

Staritng timer software for rc cars

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Staritng timer software for rc cars

    Hi guys,i made some hardware for lap timer for rc rally cars.Software for this timer can register switching two pins on serial port so i made simple photocell gate with rellay,everything is working well..but i have problem with starting timer on another computer. Cars starting every minute,i need this beeping :

    30s to start -1short beep,
    10s to start -2short beeps,
    3,2,1s - short beeping
    0(start) - 1 long

    and repeat this every minute.Time must be taken from system time because i have another program,simple full screen clock where is running time for racers.
    Problem is that i cannot find some software which can do this. I tested maybe 10 alarm clock softs,tried to find some info arround but nothing...
    Maybe someone from you know some software which work like i need,i appriciate every help..

    #2
    Re: Staritng timer software for rc cars

    What are you trying to do this on, will it be running on a PC or you want hardware/microcontroller/etc. to do this... do you have lights to also alert the driver to start that the beeper needs to be synchronized with?

    Comment


      #3
      Re: Staritng timer software for rc cars

      Lap timer is running on one computer with windows,this computer register cars at the end of the track. I need solution for starting timer,my idea was runnig it on computer or tablet,i have time and display there-with some software is this the simplest solution.Another solition is making something with arduino but there i need to make some kind of display,some board,RTC .. what is more expensive and time consumpting.Actually i dont need to synchronize times on this two devices,i dont need the exact time of lap,i need only diferences between two cars.I had also another idea,sending time over serial port to ardiuno and simple sketch which compare the received time and beeps on some pin,amplifier and 2 small speakers. I made also some batch script which send this time to serial but i cannot read it on arduino for some reason,dont know why,learning python or c++ to coding something on computer is not the simplest thing now :-D

      Comment


        #4
        Re: Staritng timer software for rc cars

        This seems to be fairly straightforward software, but maybe a little more complex if you want it interrupt driven for timing accuracy.

        I was also a bit concerned over accuracy is false starts, if someone jumps the gun. Else all you need to do for an inaccurate program to do this is very simple:

        def oneshortbeep():
        start_beep(low_frequency)
        sleep (100ms)
        stop_beep()
        sleep (900ms)

        def twoshortbeep():
        start_beep(low_frequency)
        sleep (100ms)
        stop_beep()
        sleep (100ms)
        start_beep(low frequency)
        sleep (100ms)
        stop_beep()
        sleep (700ms)

        def longbeep():
        start_beep(high_frequency)
        sleep (1000ms)
        stop_beep()

        while True:
        sleep(29s)
        oneshortbeep()
        sleep(19s)
        twoshortbeep()
        sleep(6s)
        oneshortbeep()
        oneshortbeep()
        oneshortbeep()
        longbeep()


        This is NOT timing accurate but should be very close to 1 minute. You'd have to tweak the instruction timings to get exactly 1 minute or use a timer with a well-defined clock.

        Comment


          #5
          Re: Staritng timer software for rc cars

          Thanks for this but i have no experience with this language,i downloaded python,copyied it to IDLE a tried to run but i get error in start_beep .. need i also some "header" or some kind of library (like in C) to run this?

          Comment


            #6
            Re: Staritng timer software for rc cars

            It's meant to be pseudocode - human readable and not any specific language.

            Now exact language details require what language you're targeting...

            Comment


              #7
              Re: Staritng timer software for rc cars

              ok,i understand this program,also can write something like this for arduino or some atmel avr in C or assembler, but i cannot write line of code for computer except some bash script

              Comment


                #8
                Re: Staritng timer software for rc cars

                Well you could write it in bash on a Linux PC's pc-speaker:

                #!/bin/bash
                while true; do
                sleep 29
                beep -f 400 -l 100 -D 900
                sleep 19
                beep -f 400 -l 100 -d 100 -n -f 400 -l 100 -D 700
                sleep 6
                beep -f 400 -l 100 -D 900
                beep -f 400 -l 100 -D 900
                beep -f 400 -l 100 -D 900
                beep -f 1000 -l 500 -D 500
                done


                once again this is not time accurate, it takes over one minute to get through this loop so it won't match up with the clock.

                Comment


                  #9
                  Re: Staritng timer software for rc cars

                  because this computer is running windows.. i know,i can run bash script also in win but this is not the best solution,i think here can be the inacuraccy even more significant..maybe something more complex with comparing with actual system time.but i really think that exist some timer program which can do what i need and is also user friendy with graphic interface etc.(this lap timer is not for me) Or the solution with hardware beeper. I can send actual time to serial on arduino with command batch script,i see also some activity on this port but on arduino i get nothing.null.both sides are configured to 9600 8n1. if i send it to stdout-i get system time in 1/100 resolution without problems. I found also some example programs in python to communicate with arduino over serial,maybe this is the right way.

                  Comment

                  Working...
                  X