Skip to content

Commit

Permalink
Add battery protocol docs
Browse files Browse the repository at this point in the history
  • Loading branch information
doinkythederp committed May 13, 2024
1 parent 5c758f5 commit e0fc15d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/simulators/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Commands are sent from the frontend to the backend and signal for specific actio
- port: [AdiPort](#adiport)
- voltage: float
- `StartExecution`: Start executing user code. This should be treated as a no-op by the backend until it sends a `Ready` [`Event`](#events).
- `SetBatteryCapacity`: Updates the remaining battery capacity to a new Watt-Hours value. If this command is not sent, the simulator must default to a value of 14 Watt-Hours, the maximum capacity of the VEX V5 battery. This value may be used by the simulator to help calculate the voltage of the battery. Fields:
- capacity: float in Watt-Hours

## Data types

Expand Down Expand Up @@ -210,6 +212,15 @@ Variants:
- `Warn`: possible issues or errors that do not directly affect the simulation
- `Error`: issues and errors that degrade the simulation

### Battery

A struct containing information about the current state of the battery
Fields:

- `voltage`: The output voltage of the battery. Float value in Volts.
- `current`: The current draw of the battery. Float value in Amps.
- `capacity`: The remaining energy capacity of the battery. Float value in Watt-Hours.

## Notes

- Rust implementation available at <https://docs.rs/pros-simulator-interface>.
Expand Down

0 comments on commit e0fc15d

Please sign in to comment.