Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.


Measuring distance on move


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-22-2007, 10:53 PM
Junior Member
 
Join Date: May 2007
Posts: 34
Default Measuring distance on move

I have made a small application to measure the distance on moving. By now I`ve only tested it at 6 to 10 km/h. And so far it worked not bad, but there are still some bugs that I didn`t get rid of yet.
I think one problem is that the timers should work syncronised, but I don`t know how to manage that.

Or maybe I did a big mistake and don`t see/know it. I am not so sure if the calculation with those utm-data is correct. The tests weren`t much precise so far.

If some of you can need this then you are welcome to help me a little bit.
At first you need to add the .dll for serial and GPS of course and you must replace the port and baud-rate to those your GPS-reciever uses.

edit: I forgot to say that its only possible to start measuring when standing still (speed < 1). This can be changed in the code.
Attached Files
File Type: zip Distmeter.zip (1.3 KB, 108 views)

Last edited by Agrartec : 06-24-2007 at 07:29 PM.
Reply With Quote
  #2 (permalink)  
Old 06-28-2007, 01:58 PM
Junior Member
 
Join Date: May 2007
Location: Germany
Posts: 31
Default GPS Distance Meter

Hi agrartec,

this is a version without the 2. timer.

For good precission you should not calculate with rounded UTM-Data.
(If you watch the data, you see that most differences happen behind the comma)

In this version I introduced an additional button to switch the GPS-device.
Then it's possible to restart the GPS connection, after a power off and power on of you PDA, automatically.

Code:
Sub Timer1_Tick
  if serial.InBufferCount>0 then 
    GPS.GPSStream(gps.GPSStream(Serial.InputString)) 'Takes the data received from the GPS to GPSStream.
  else      
    ' reactivate GPS after a power off/on automatically when GPS was active before
    sleep(2000)
    if serial.InBufferCount<=0 then      
      if BtGPS.color=cGreen then
        serial.EnableOnComm =false
        Serial.PortOpen = false 'Closes the seria
        TBsats.text=""
        serial.EnableOnComm =true
        Serial.PortOpen = true 
      end if    
    end if
  end if
End Sub
Ciao
BerndB
Attached Files
File Type: zip Distmeter2.zip (1.6 KB, 97 views)
Reply With Quote
  #3 (permalink)  
Old 06-28-2007, 02:17 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,141
Default

Nice tip
Reply With Quote
  #4 (permalink)  
Old 06-28-2007, 10:43 PM
Junior Member
 
Join Date: May 2007
Posts: 34
Default

Thanks a lot, works better than my version.


A little hint so that it really works: it is "cgray" and not "cgrey".
Reply With Quote
  #5 (permalink)  
Old 06-28-2007, 11:10 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,318
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

A note about cGray!!
VB supports both cGrey and cGray althought the correct English form is Grey....So sometimes developers wich code in bth platforms get mixed up...
Basic4PPC is a "English correct" enviroment!!!
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #6 (permalink)  
Old 06-29-2007, 10:57 AM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 485
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Basic4PPC is a "English correct" enviroment!!!
Not strictly true... colour is still spelt Color

Regards
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #7 (permalink)  
Old 06-29-2007, 11:27 AM
JJM JJM is offline
Knows the basics
 
Join Date: Apr 2007
Location: France
Posts: 80
Default

Hello,

On Harrap's dictonnary
gray is an americain word
grey is a britanic word !!!...
bye

JJ M
Reply With Quote
  #8 (permalink)  
Old 06-29-2007, 05:56 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,318
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

I think that Colour is not a English word but more of an Americanized form of the word...

A derivated word like colored is not written "coloured"....

Anyway this is
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #9 (permalink)  
Old 06-29-2007, 06:13 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 485
Awards Showcase
Beta Tester 
Total Awards: 1
Default

You started it!


Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #10 (permalink)  
Old 07-01-2007, 02:07 PM
Junior Member
 
Join Date: May 2007
Posts: 34
Default

Ok, it seems that there are small differences in English and American spelling. But I had the problem that only "cgray" was accepted by B4ppc. When I use the code as BerndB wrote it, then I get error "cgrey is not a variable" or so.

Does the code work at other people here with "cgrey"?

Greets John.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
move to the last row at a table Georg Questions & Help Needed 2 05-20-2008 09:43 PM
Calculating distance abastien Code Samples & Tips 4 05-15-2008 07:11 PM
GPS Distance Problem Georg Questions & Help Needed 6 04-25-2008 05:10 AM
Distance-test on UTM and LAT-LON Put Claude Questions & Help Needed 1 10-16-2007 02:06 PM
Distance Calculator PatrikL Share Your Creations 7 04-30-2007 06:15 PM


All times are GMT. The time now is 06:53 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0