in reply to Very light weight GPS position
With that little problem solved the script below works quite well.ppm>install http://www.bribes.org/perl/ppm/Win32-SerialPort.ppd
I am thinking more possibilities for tinkering there will soon be! :)#!/usr/bin/perl use warnings; use strict; use Tk; use GPS::Garmin; use Win32::SerialPort; my $mw = MainWindow->new; $mw->withdraw; my $location; my $gps = new GPS::Garmin( 'Port' => 'COM4', 'Baud' => 9600, ); my ($latsign,$lat,$lonsign,$lon) = $gps->get_position; my ($sec,$min,$hour,$mday,$mon,$year) = $gps->get_time; my $time="$hour:$min:$sec"; $lat=sprintf("%.4f",$lat); $lon=sprintf("%.4f",$lon); $location="$lat$latsign $lon$lonsign"; my $locationandtime="$lat$latsign $lon$lonsign\n$time"." GMT"; $mw->messageBox ( -message => $locationandtime, -title => 'Time and location', -type + => 'Ok' );
|
|---|