Trouble with event.speed

This is probably a pretty noob question. I’ve just finished my first year of information science in college and I’ve only been programming for about as long. I’m working on a simple bike computer app that will return the speed of the rider, and I’m totally stuck on how to get that. I’m trying to utilize the function shown here:

http://docs.coronalabs.com/api/event/location/speed.html#overview

I’m getting all sorts of different errors. The main one I’m getting without any modification of the code shown on that page is "attempt to index global ‘latitude’ (a nil value).

How exactly do I implement this function??

Any help is greatly appreciated.

Look in the SampleCode folder where your CoronaSDK is installed.  Inside of that folder will be another folder called “Hardware” and then inside of there “GPS”.  This code is a snippet from that sample app.  You can see the whole thing if you look at the sample app.  Also the code on that page is a bit dated, we handle updating display.newText() objects differently now.  The GPS SampleCode will be correct.  I’ve asked to get the documentation updated.

Rob

I totally forgot about the sample code… I feel really silly now. Sorry, and thanks for the reminder!

Look in the SampleCode folder where your CoronaSDK is installed.  Inside of that folder will be another folder called “Hardware” and then inside of there “GPS”.  This code is a snippet from that sample app.  You can see the whole thing if you look at the sample app.  Also the code on that page is a bit dated, we handle updating display.newText() objects differently now.  The GPS SampleCode will be correct.  I’ve asked to get the documentation updated.

Rob

I totally forgot about the sample code… I feel really silly now. Sorry, and thanks for the reminder!