I made a Reverse Geocache Box based off of Mikal Hart’s design (http://archive.makezine.com/25/puzzlebox/) for an electronics course. I also based my design off of Tyler Cooper’s Adafruit guide (http://learn.adafruit.com/reverse-geocache-engagement-box/overview) since we both use an Adafruit Ultimate GPS receiver. One major difference in my design is that I’m using an ATMega328P microcontroller and an FTDI basic breakout to upload sketches.
I’m having an issue serially transmitting the GPS data from the GPS reciever to the TinyGPS library that processes the data to calculate the distance that the box is from its destination coordinates. It seems that the speed (baud rate?) of the serial data transmission on the “send” end is too slow, so the tinygps.encode() function doesn’t recognize any complete data sentences, which is required in order to determine the GPS receiver’s latitude and longitude. Attached is my code, I’ve changed the destination coordinates to the Empire State Building as an arbitrary location which can be used for testing. I would like the tinygps.encode() function to determine distance (in meters) between the box and its destination coordinates so this data can be displayed on the LCD for the user. Everything else inside the box such as the servo, the push button, sleep mode, etc. seems to work great.
Also, I am still sort of a beginner at writing code/using Arduino so I’m open to any suggestions! Thank you.
ReverseGeocacheBoxForum.ino (9.22 KB)