Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This state machine governs the running state of the car and defines the conditions under which the driver can turn on and move the vehicle. Transitions for this FSM depend on the state of the directional state machine.

StateDescriptionTransition

Off

The vehicle is not receiving power
  • Receiver POWER_OFF signal while in brake and neutral.

Brake

The car is on, but braking is active
  • Receive POWER_ON signal while in the off state
  • Receive GAS_BRAKE signal while in coast, drive, or cruise control

Coast

The gas pedal is pressed just enough to allow the car to coast.
  • Receive GAS_COAST signal while in the brake or drive state
DriveThe brakes are engaged and the car is not moving
  • Receive GAS_DRIVE while in the coast state or brake state (Direction state must be in either forward or reverse)
Cruise ControlThe car is currently in cruise control mode
  • Receive CRUISE_CONTROL_ON while in coast or drive


Directional State Machine

This state machine governs the possible gear shifts made by the user. Transitions in the pedal state machine depend on the current state of this FSM.

StateDescriptionTransition
NeutralThe vehicle is in neutral gear
  • Receive DIRECTION_SELECTOR_NEUTRAL signal while the Pedal FSM is in the brake state
ForwardThe vehicle is in forward gear
  • Receive DIRECTION_SELECTOR_FORWARD signal while the Pedal FSM is in the brake state
ReverseThe vehicle is in reverse
  • Receive DIRECTION_SELECTOR_REVERSE signal while the Pedal FSM is in the brake state


Turn Signal State Machine

This state machine governs the states of the turn signals made by the driver. Independent from the other FSMs.

StateDescriptionTransition
No signalThe car is currently not signalling
  • Receive TURN_SIGNAL_NONE signal while either signal is active
Left signalThe car has the left signal active
  • Receive TURN_SIGNAL_LEFT signal while the left signal is inactive
Right signalThe car has the left signal active
  • Receive TURN_SIGNAL_RIGHT signal while the right signal is inactive

Hazard Light State Machine

StateDescriptionTransition
Hazard Light On

Hazard lights are currently active

  • Receive HAZARD_LIGHT_ON signal while hazard lights are off
Hazard Light OffHazard lights are currently inactive
  • Receive HAZARD_LIGHT_OFF signal while hazard lights are on


ADC Driver

Description

The STM32 has a 12-bit onboard analog-to-digitalĀ converter (ADC). The role of an ADC is to take an analog signal as an input and give as output a digital number proportional to the magnitude of the input signal. The ADC on the STM32 has 19 multiplexed channels, allowing it to read signals from 16 external sources and 3 internal sources. The pin mappings for the 16 external sources are included below:

...