You said that you are a novice, Do you have any experience of C or assembly programming. As far as your question concern, your program requirement is not simple.
However i shall guide you.
You may do your work with just one microcontroller, but you need multiplexing technique for this, as your described cntroller has 15 I/Os and you are interfacing 17 LEDs, 1 push button switch and 1 buzzer.
For Buzzer one output is required.
For Push button one input is required.
For 3 rotation LEDs and 2 Speed LEDs you need 5 outputs
For 12 LEDs you may connect all 12 LEDs in 4x3 format, 12 LEDs in 4 rows and 3 coloums, which consumed 7 outputs.
So, Total 14 I/Os are consumed, 1 is still free.
I assumed that you have some basic knowledge of microcontroller programming and its all registers.
You have to make your program in modular form (module: small or a big program) and labeled them according their function name, each function has its own module. Let say LED Chaser function module name may be LED_Chaseer or LED_Chase.
Make one module for Timer function and one for switch and buzzer funcion.
ONE Timer interrupt function, where you are driving all LEDs.
One main function is obviously required for running continously. In this MAIN function, you have to read switch function first than start timer by sending timer function a value. On every timer interrupt drive LEDs as you want. and than increment or decrement timer value for LED Visual change.
From this way you can get your results.
Wish you best of Luck
Rather than transmit the marker ID code from the marker to a central receiver,
perhaps it would be simpler to transmit the marker ID code from a central transmitter to the marker.
The central transmitter (perhaps a 38 kHz IR transmitter or some wireless transmitter) would send, in effect, "Marker number 22, please turn on for the next 20 ms on my mark: NOW".
(Ideally, while that marker is glowing for those 20 ms, the central transmitter is sending out the ID of the next marker to turn on).
Since that one central transmitter is controlling the timing, you won't have to deal with markers getting out-of-sync and accidentally transmitting at the same time.
Hopefully you can place that central transmitter close enough to the position tracker, so that if any marker can't see the commands sent by the central transmitter, that marker wouldn't be in the visual field of the position tracker anyway.
That also gives you the flexibility of using the data you get back from your position tracker to dynamically adapt which markers you select:
- If some markers seem to be motionless or extremely slow-moving, perhaps you only need to check on them once every 3 seconds or so.
- Perhaps you can check up on the latest positions of more than one marker at a time; something like "OK, marker number 22 and 23, please turn on for the next 20 ms on my mark: NOW".
- If some markers are not visible from this vantage point, perhaps you only need to check if any of them have re-entered the visual field once every 3 seconds or so.
- The time slots you free up with the above techniques could be used to track the remaining markers at a somewhat faster update rate than you could if you simply cycle through every marker in a fixed pattern.
- If, say, marker #22 is so close to marker #23 that receiver of #23 is blinded when marker #22 is active, you could shuffle the order you turn on the markers so that the "#23 please turn on" message happens a few slots before the "#22 please turn on" message.
Best Answer
If you want to take a stab at multiplexing or using shift registers, I would recommend visiting these links:
The Arduino is used in both those tutorials, but it should be relatively easy to apply the same concepts to your microcontroller.