Introducing the Serialport_gps gem

Defaults:

require 'serialport_gps'

gps = SerialPortGPS.new
gps.start

Output:

{:time=>2014-07-05 21:53:40 +0000, :latitude=>55.92721483, :longitude=>-3.13518783}
{:time=>2014-07-05 21:53:44 +0000, :latitude=>55.92720717, :longitude=>-3.13513767}
{:time=>2014-07-05 21:53:52 +0000, :latitude=>55.92721417, :longitude=>-3.135116}
{:time=>2014-07-05 21:54:00 +0000, :latitude=>55.92722817, :longitude=>-3.13505783}
{:time=>2014-07-05 21:54:08 +0000, :latitude=>55.92722067, :longitude=>-3.1469765}
{:time=>2014-07-05 21:54:16 +0000, :latitude=>55.92720633, :longitude=>-3.13509533}
{:time=>2014-07-05 21:54:24 +0000, :latitude=>55.92720567, :longitude=>-3.1350735}
{:time=>2014-07-05 21:54:32 +0000, :latitude=>55.92721317, :longitude=>-3.13508183}

There is a callback proc which can be passed in at initialization which is triggered when new GPS data has arrived. The default callback which can be seen from the output above is used for testing purposes, as well as demonstrating what the gem outputs.

Resources

Tags:
Source:
2308hrs.txt
Published:
05-07-2014 23:08