You've made it to the last example lab on this gitbook! In this lab, we will learn how to create our own app that harnesses both the publish and subscribe protocols in uORB.
In this lab, we won't be guiding you through creating this program, but we will give instructions on how to complete it. Don't worry though, if you get stuck there is a solution file that you can reference to learn how to complete this lab.
The objective of this lab is to harness the data published by the magnetometer (compass) on the FMU and control the RGB LED when you're facing north. You should also print a message to the Mavlink console that you're facing north along with the magnetometer data.
Here's a small demo of what the output should look like. You should have some sort of logging in the Mavlink console as well as the LED flashing red when you're facing north.
If you need the solution to figure it out, or want to view some of the other tutorial files, go to this link: https://github.com/NXPHoverGames/Tutorials/blob/master/TutorialApplications/hg_magnet/hg_magnet.cpp
See if you can make the LED blink a different color for North, South, East, and West!
Thanks for following these tutorials. If you would like to see more, or have feedback or corrections please email us at [email protected] or on https://community.nxp.com/community/mobilerobotics