This project aims to monitor the output voltages of the brake and accelerator pedals of a Formula race car and convert them into a CAN message format to be sent to the car MCU. The potentiometers in both pedals output feed into two analog input pins on the Arduino microcontroller, and the Arduino CAN library is utilized to convert the analog signals from the pedals into a CAN message.
The CAN Protocol (V6_1).pdf provides detailed information on the CAN protocol and the necessary steps to convert the potentiometer values into a CAN message format. It is important to follow the specifications outlined in the datasheet to ensure that the converted message is accurate and can be successfully sent to the car MCU.
- Write the code to read the potentiometer values from the analog input pins on the Arduino
- Use the CAN library to convert the potentiometer values into a CAN message format
The first task involves writing the code to read the potentiometer values from the analog input pins on the Arduino. The potentiometers are inverse, which means that a voltage of [0-5]V corresponds to [5-0]V. Therefore, the code needs to account for this inverse relationship and accurately read the potentiometer values.
The second task involves utilizing the Arduino CAN library to convert the potentiometer values into a CAN message format. The CAN Datasheet provides guidance for this task and should be consulted during the implementation.