...
The pedal project will consist of 1 task and the master_task. It will also use CAN. The project should divided into 3 .c
files; is fully contained in the main.c
file with a few functions init_pedal_controls
, read_pedal_controls.cthrottle
, read_pedal_throttle
, pedal_calibrate
.
main.c
The main file should initialize CAN, all the tasks, and any other modules that will be used. The file should look like the standard main.c
for every project. Use scons new --project=pedal
to make a new project.
...
Runs
pedal_controls
Runs
can_tx_task
pedal_controls.c
...
task
...
The init_pedal_controls
function should initialize the GPIOs needed for the throttle, and initialize ADC for ADC readings. It should also calibrate the pedal upon initialization (set what we consider max value and min value for each pedal).
...
The read_pedal_brake
function should read any GPIOs and the ADC for throttle.
pedal_calibrate
needs to read the ADC when the throttle and brake are pressed down, and when they are let go, and use that reading to set the upper and lower bounds of the pedal (subject to change, based off of MSXIV).
CAN Messages:
See pedal.yaml
...