Traffic Monitor LEDs
The 4 LEDs that reflect traffic to/from the Laptop and to/from the Arduino are controlled by the Monitor class.
The Traffic class should create an instance of traffic.Monitor(). Monitor functions should only be called by the Traffic class.
When called, the four functions (from_LT, from_BS, to_LT and to_BS) create a thread to blink a LED.
In the traffic module
- blink_it(self, LED, blink)
- Common routine to blink a LED
LED - a variable equal to 1 of 4 LED objects
blink - length of the message received/sent
- from_BS(self, num)
- Blink the BLUE LED for traffic from the Base Station
Arg: length of message received from the Base Station
- from_LT(self, num)
- Blink the ORANGE LED for traffic from the Laptop
Arg: length of the message received i.e. len(message)
- to_BS(self, num)
- Blink the ORANGE LED for traffic to the Base Station
Arg: length of message sent to the Base Station