The purpose of lights control boards is to receive instructions from the driver controls board through a CAN message and take action accordingly. There are two lights boards on the car. One board is located at the front and one at the back. The boards will use the same software. Thus, software needs to determine which board it's being operated on. The responsibilities of each board is as follows:
Front Board:
- Headlights: control the TESLA headlights.
- Left and Right Signals: Blink the left and right signals.
- Hazard: blinking signals for hazard.
- Horn: for activating (honking) the horn.
Rear Board:
- Brake Lights: Control the brake lights
- Strobe Light
- Left and Right Signals
- Hazard
Challenges:
Description | Solution |
---|---|
How to detect whether it's the front board or the rear board? | There will possibly be a gpio address that we'll be able to read from. |
How to sync both the front and the back board when blinking? The timer on both boards will not be identical so some communication needs to happen between the boards to make sure they're both blinking at the same time. | Implementation of this solution should be a module that's independent from the rest of the program. e.g: The state machine logic for signals and hazard should simply make function calls and not worry about keeping the boards in sync. One board probably will need to send a can message to the other board, and both boards will reset their timers. This doesn't have to happen too frequently, probably every couple seconds. |