![]() My code: // Including appropriate librariesĬompass.SetOrientation(COMPASS_HORIZONTAL_X_NORTH) If anyone can help, it would be much appreciated! I've spent the last 90 mins on this but haven't been able to crack it. For example you may get 112.13 when the robot is facing me but get it again when its a bit more to the right for instance. The values also repeat at certain places. I wired everything, HMC5883L's SDA going to pin 18 on the Teensy, and the HMC5883L's SCL going to pin 19 on the Teensy and I upload the code (same code that worked perfectly on the Arduino Mega), and I get values ranging from 112.9 to 112.41. However I need to have everything in a PCB and decided to use the Teensy 4.1 as I didn't have to change my code much. ![]() Using an arduino mega wires and the HMC5883L I managed to do this. I am participating in a contest, details don't really matter but I need to use the compass to make the robot return to a certain heading when required.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |