small target silhouette Code

The target system employs several levels of software written in C and C++ and for multiple platforms:

  • Target timer (AVR, C)
  • Target server (Windows/Linux, C++)
  • Target client (Windows/Linux, C++)

The code can be downloaded ready to go (read the How-To for information on programming the microcontrollers). Here we will provide an explanation of how it works.

Target Timer

The complete target timer system consists of two or more individual target timers. Each timer measures the TDOA between two sensors. The logic involved can be broken into two sections.

Main Routine Pseudocode

Note: this logic is very simplified and is based on a model that does not use interrupts or ICP.


			main loop:

			 if ch1 triggered:

			  start timer

			  inner loop 1:

			   if ch2 triggered:

			    stop timer

			    report the time

			    pause

			    break to main loop

			 if ch2 triggered:

			  start timer

			  inner loop 2:

			   if ch1 triggered:

			    stop timer

			    report the time

			    pause

			    break to main loop
Trigger Analysis Subroutine Pseudocode

			channel trigger subroutine:

			 if past threshold:

			  if zero:

			   trigger channel

			  else:

			   if threshold:

			    past threshold = true