It sounds like you need an APPS or Accelerator (AKA throttle) position sensor
...& a BOTS Brake Over Travel Switch
...& a BSPD or Brake System Plausibility Device
They both send signals to the BSPD
...then, "if" the accelerator is actuated while braking
...or "if" the brake pedal was to "over travel"
...the BSPD will "kill" the "power" (gas or electric) going to the wheels.
Here is some info from the Formula SAE RULES 2022
EV.5.5 Accelerator Pedal Position Sensor - APPS
EV.5.5.1 Refer to T.4.2 for specific requirements of the APPS
EV.5.5.2 Drive by wire control of wheel torque is permitted.
EV.5.5.3 Any algorithm or electronic control unit that can adjust the requested wheel torque may only lower the total driver requested torque and must not increase it.
EV.5.6 Brake System Encoder - BSE
EV.5.6.1 Refer to T.4.3 for specific requirements of the BSE EV.5.7 APPS / Brake Pedal Plausibility Check
EV.5.7.1 The power to the Motor(s) must be immediately and completely shut down when both of the following exist at the same time: • The mechanical brakes are actuated • The APPS signals more than 25% pedal travel This must be demonstrated at Technical Inspection
EV.5.7.2 The Motor shut down must remain active until the APPS signals less than 5% pedal travel, with or without brake operation.
EV.8.7 Brake System Plausibility Device - BSPD
EV.8.7.1 The vehicle must have a standalone nonprogrammable circuit to check for simultaneous braking and high power output
EV.8.7.2 The BSPD must be provided in addition to the APPS / Brake Pedal Plausibility Check (EV.5.7)
EV.8.7.3 The BSPD must Open the Shutdown Circuit EV.8.2.2 when both of the following exist:
• Braking hard without locking the wheels
• Motor/Accumulator current is at a level where 5 kW of electrical power in the DC circuit is delivered to the Motors at the nominal battery voltage. The BSPD may delay opening the shutdown circuit up to 0.5 sec to avoid false trips
EV.8.7.4 The BSPD must Open the Shutdown Circuit EV.8.2.2 when there is an open or short circuit in any sensor input
EV.8.7.5 The team must have a test to demonstrate BSPD operation at Electrical Technical Inspection. a. Power must not be sent to the Motor(s) of the vehicle during the test b. The test must prove the function of the complete BSPD, including the current sensor The suggested test would introduce a current by a separate wire from an external power supply simulating the Tractive System current while pressing the brake pedal
T.3.2 Brake Over Travel Switch - BOTS
T.3.2.1 The vehicle must have a Brake Over Travel Switch (BOTS). Brake pedal travel exceeding the normal range will actuate the switch
T.3.2.2 The BOTS must be a mechanical single pole, single throw (commonly known as a two position) switch (push-pull or flip type).
T.3.2.3 Operation of the BOTS to the OFF position must Open the Shutdown Circuit IC.9.2.2 / EV.8.2.2
T.3.2.4 Repeated operation of the switch must not reset or restore power
T.3.2.5 The driver must not be able to reset the BOTS.
T.3.2.6 The switch must be implemented with analog components, and not using programmable logic controllers, engine control units, or similar functioning digital controllers.