7. Compass¶
In this project, Zeus Car will become a compass. You will need to set a heading direction for it, and then no matter how you turn it, it will be facing there.
Note
If electrical wires are present near the Zeus Car, the electromagnetic field will interfere with the operation of the qmc6310 module, thus changing the heading direction of the car.
How to do?
The ESP32-CAM and the Arduino board share the same RX (receive) and TX (transmit) pins. So, when you’re uploading code, you’ll need to first disconnect the ESP32-CAM to avoid any conflicts or potential issues.
Open the
7_compass.ino
file under the path ofzeus-car-main\examples\7_compass
.After the code is uploaded successfully, slide the power switch to ON to start the Zeus Car.
First let’s calibrate the qmc6310 module.
Turn the car to the direction you want it to face and press . After that, whatever direction you turn it, it will slowly turn back to the set direction.
The magnetic fields on the ground and on the table are not the same and need to be recalibrated.