Hello everyone! I would like to start by saying that this is a pretty sweet website, and what you guys are doing is awesome. I was hoping my first post on here would be a contribution, but, unfortunately, that is not going to happen.
So I am trying to impliment two way communication with a ground station that some friends of mine are working on. The goal is to add the ability to change waypoints while in the air and anything else we haven't thought of yet. I am doing this by adding a soft serial line to analog pins 4 and 5. The EEPROM based waypoint system is to remain an option, with a command to switch between EEPROM and non-EEPROM waypoints (I think the term is flash?). The idea is to create arrays, and use the WP number to index to them, pretty simple.
The modifications made to the code are minimal, I changed arround the set_waypoint slightly to have two different locations to get new waypoints and to check to see if the next waypoint s blank, and added the command "commander();" to the main loop. I will post the code associated with this in a file called "clarence". I also modified the navigation loop to always update wp (for debugging) and changed the "print_data()" function to include a time stamp, ID and changed its format slightly. If there is interest prior to me finishing and polishing this thing, I would be more than happy to post it.
So far, in the lab at least, everything works great, we are able to use the system to full capability, being able to switch to waypoints, insert, delete, print, modify and erase all. The problem is all this functionality works with only latitude and longitude, but not altitude.
So after mucho time debugging, I have concluded that the problem lies when writing to the array wp_alts, in the function called "saveIt()" . In the attached code the second to last line is commented out, and everything works fine so long as this line is commented out. If I remove the comments, none of the soft serial communication works, it seems to omit things at random, and insert additional characters, even when the function saveIt(); is not called (for example, when I send the command "1D$" the data printed is distorted when the line is not commented out). Now here is why I think this may be a memory problem, when I change the size of the array wp_alts from 100 (more than 100 waypoints is not neccessary with two wayt telem) to 2, things work fine (but then I can only have 2 wps!). I know this is a difficult quest to respond to, but I am not a programmer by any means, and I am stumped! Also, I am very open to suggestions to making my code "better" or more efficient!
Thanks in advance!