Type-Safe Units
Volt provides type-safe units to increase readability through your codebase.
Available Units
Section titled “Available Units”| Unit | Range | Example |
|---|---|---|
Inches |
any | val dist = 24.inches |
Radians |
any | val angle = PI.radians |
Degrees |
any | val angle = 90.degrees |
Power |
-1.0..1.0 | val power = 0.9.power |
Ticks |
any | val dist = 1000.ticks |
Seconds |
>=0 | val time = 10.seconds |
ServoPosition |
0.0..1.0 | val pos = 0.5.servoPosition |
Voltage |
any | val v = 3.3.voltage |