Arduino compas and head for flysky i6

Hello. I tried a project a long time ago, I reached a stage where I was stuck. I have a flysky i6 to which I connected an arduino nano together with a neo6 gps and an HMC5883 compass. I managed to make the SWA button on the radio control to save the GPS data in the arduino Eeprom and SWB to read the data. The problem occurs with Head and Cog... I don't know why the values ​​don't show well... The Head shows between 180-200...
if I try to add the swc and swd buttons to save point 2 with the same code logic after swa and swb, it no longer shows the distance to the saved point only at location 2 (swc,swd) at first it shows an erroneous 38400 and from there it decreases as it should, but the head does not display at any point. Do you have any idea what could be the problem?

Thak you!


Please edit your post, select all code and click the <CODE/> button to apply code tags. Next save your post.

This will make it easier to read, easier to copy and the forum software will display it correctly.

Please post complete code.

Your savelocation2() overwrites the data that was stored in savelocation(). Below an attempt to visualise

EEPROM layout
							        1                   2                   3                   4
				0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
				[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
saveLocation          lat.............lon.............
saveLocation2                                   lat.............lon.............

You will have to add the initial address that was used in savelocation() to the address used in savelocation2().

In that case I do not know the answer.

Use an off-the-shelf basic flight controller and Inav.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.