PolarRobotics.h#
Description#
PolarRobotics.his the corresponding header file tomain.cpp, and is also included in most other files.It contains global declarations useful for many parts of the codebase, namely motor pin definitions.
Defined Pins#
See also
Our ESP32 pin reference sheet provides more detailed (and probably more up-to-date) information.
Drive Motor Pins#
There are four defined motor pins.
For most robots, only the first two are needed, and they are the left and right motors, respectively (see “Cfg. 2W”).
For four-wheel-drive robots, namely the mecanum center, all four pins are needed (see “Cfg. 4W”).
Motor # |
Pin # |
|
Cfg. 2W |
Cfg. 4W |
|---|---|---|---|---|
1 |
32 |
|
Left |
Left Front |
2 |
33 |
|
Right |
Right Front |
3 |
26 |
|
N/A |
Left Rear |
4 |
27 |
|
N/A |
Right Rear |
“Special Bot” Pins#
These pins are reserved for robots that require additional actuators beyond the standard drive wheels.
These “special bots” include positions such as the kicker, center, and quarterback.
Pin # |
|
|---|---|
18 |
|
19 |
|
21 |
|
22 |
|
Encoder Pins#
These pins are reserved for motor encoders. Most of these are input only.
Some of these have alternate names as they appear on the PCB of the ESP32.
Four pins is enough to support two encoders (1, 2) each with two channels (A, B).
Pin # |
Alt. Name |
|
|---|---|---|
35 |
|
|
34 |
|
|
36 |
VP |
|
39 |
VN |
|
Other Pins#
A variety of other pins are defined for various usages.
Note that the UART pins are currently only used for the Quarterback V3.
Pin # |
|
Description |
|---|---|---|
4 |
|
LED Lights |
13 |
|
Tackle Sensor |
23 |
|
Pairing (if pin-pairing is enabled) |
16 |
|
Receiver pin for serial comm. w/ other ESP |
17 |
|
Transmitter pin for serial comm. w/ other ESP |