| Versions |
 |
|
| Author |
Topic  |
|
|
ganrang
4 Posts |
Posted - 13 août 2007 : 16:30:23
|
I am learning to program on my Windows Mobile 5.0 device which has GPS. I just wrote a small code and compiled ...shown at end of this message. It is ridiculous - hard-coded com port and message box to show 10 lines of output etc., but I plan to work on it. As it is it works! I can see message boxes with sirf specifc output
Can someone suggest what sort of form/control to use to show the output as series of lines in a notepad kind of output? The Console.writeline does not work and I have been searching around in vain.. Textbox also seems unsuitable.
Eventually I plan to pass this output to some code that will parse it and show basic location, satellites etc. as a nice way of learning more about .NET and GPS.
Thanks..
--------------------------- using System; using System.IO.Ports; using System.Windows.Forms;
public class PortOpenShow { public static void Main() { SerialPort GPSport = new SerialPort("COM2", 4800, Parity.None, 8, StopBits.One); GPSport.Open(); for (int i = 1; i <= 10; i++) { // Console.WriteLine(GPSport.ReadLine()) does not show anything; MessageBox.Show(GPSport.ReadLine()); } MessageBox.Show("Done"); GPSport.Close(); } }
|
|
|
Ads
|
|
|
JLove25
USA
2 Posts |
Posted - 13 août 2007 : 21:50:56
|
Here is a link to a couple of GPS.net articles and website that is doing just what you're starting.
Enjoy
******************************************************* *** *** Programming with GPS.NET Global Positioning SDK *** Demonstration 1 *** Written by Jon Person (info@gpsdotnet.com) *** ******************************************************* |
 |
|
|
JLove25
USA
2 Posts |
Posted - 13 août 2007 : 21:53:09
|
Left off a pargraph Here is a link to a couple of GPS.net articles and website that is doing just what you're starting.
Enjoy
******************************************************* *** *** Programming with GPS.NET Global Positioning SDK *** Demonstration 1 *** Written by Jon Person (info@gpsdotnet.com) *** *******************************************************
This example solution for Visual Studio.NET 2003 demonstrates some of the things GPS can do using a component called "GPS.NET," available at http://www.gpsdotnet.com. GPS.NET is not required to use the other examples included with the "Writing Your Own GPS Applications" articles, and is provided only as a way to demonstrate some of the other interesting things GPS can do. |
 |
|
|
ganrang
4 Posts |
Posted - 14 août 2007 : 02:58:02
|
Thanks!.
|
 |
|
|
cmathiaz
India
13 Posts |
Posted - 15 août 2007 : 07:08:13
|
Hi, Yes. Console print or TextOut commands are not available in WinCE. You can use DrawText or SetDlgItemText(easiest way!) to print on the screen. See the source code for my Movmap program (discussed in "off-road" forum).
cmathiaz
|
 |
|
|
ganrang
4 Posts |
Posted - 16 août 2007 : 16:37:00
|
Thanks mathiaz. In the meantime, I had used StreamWriter to write to a text file. I shall try out your suggestion. I have also used XML to read a config file though it is not saving/changing config for now!
XmlDocument ConfigXMLDoc = new XmlDocument(); ConfigXMLDoc.Load(ConfigFile); string COMPort = ConfigXMLDoc.SelectSingleNode("/configuration/COMPort").Attributes["Value"].Value;
|
 |
|
|
ganrang
4 Posts |
Posted - 16 août 2007 : 16:54:04
|
BTW I should add, I dont have Visual C# or Studio etc. I just use the .NET Compact and .NET 2.0 SDK and compile manually the code using guidelines from some website. I have now started using NANT which works fine.
|
 |
|
|
hui
Singapore
1 Posts |
Posted - 02 oct. 2007 : 07:55:51
|
i have problem programming calculating the distance uisng the longitude and latitute(these data are capture from the GPS)
these are portion from my sourcecode..can anyone help..how do i include the formula to calculate the distance
char MESS[13] = "GPS RECEIVER"; char GPS[BUFFER_SIZE]; char data;
unsigned char LCD_TEMP,i; unsigned int result,j;
#pragma code InterruptVectorHigh = 0x08 // high priority interrupt vector void InterruptVector(void){ _asm goto InterruptHandlerHigh // assembly language instructions to jump _endasm // to interrupt routine }
#pragma code
//High priority interrupt routine #pragma interrupt InterruptHandlerHigh void InterruptHandlerHigh(){
if(PIR1bits.RCIF){ // check INT0 flag GPS[i] = RCREG; i++; if ( i==128){ i = 0; } PIR1bits.RCIF = 0; } }
// Main routine
void main(){
INTCONbits.GIEH = 0; // disable all interrupts ADCON1 = 0x0F; TRISC = 0b10111111; //RC7(RX) as input & RC6(TX) as output PORTC = 0b10000000; SPBRG = 52; //baud rate = 4800 TXSTA = 0b00100101; //asynchronous mode, 9-bit data RCSTA = 0b11010111; //serial port enable, 9-bit data RCSTAbits.SPEN=1; //enable usart RCSTAbits.RX9D=1; TRISA = 0b11110001; // bit 1, 2 & 3 of Port A as output TRISD = 0b00000000; RCONbits.IPEN = 1; //enable priority level on interrupt
OpenUSART(USART_TX_INT_OFF & USART_RX_INT_ON & USART_ASYNCH_MODE & USART_NINE_BIT & USART_CONT_RX & USART_BRGH_HIGH,52);
IPR1bits.RCIP = 1; //receive INTERRUPT high priority for (i = 0; i < BUFFER_SIZE; i++){ // clear the array to null first. GPS[i] = 0; // place this part immediately after initialization. } // program can't run if you place it before while(1) loop.
INTCONbits.GIEH = 1; Init_LCD();
PIE1bits.RCIE = 0; // disables receive interrupt
RCSTAbits.CREN = 0; // disable receiver
for (i = 0;i <12;i++){ W_data_4bit(MESS[i]); } PIE1bits.RCIE = 1; // enables receive interrupt
RCSTAbits.CREN = 0; // clear and set receiver. RCSTAbits.CREN = 1;
while(1){ while (!DataRdyUSART()); xx=ReadUSART(); if (xx == '$') { xx=ReadUSART(); while (!DataRdyUSART()); if (xx == 'G') { xx=ReadUSART(); while (!DataRdyUSART()); if (xx == 'P') { xx=ReadUSART(); while (!DataRdyUSART()); if (xx == 'G') { xx=ReadUSART(); while (!DataRdyUSART()); if (xx == 'G') { xx=ReadUSART(); while (!DataRdyUSART()); if (xx == 'A') { for (j = 0; j < BUFFER_SIZE;j++) { GPS[j] = ReadUSART(); while (!DataRdyUSART()); } } } } } } }
Init_LCD(); for ( k = 0; k< BUFFER_SIZE; k++) { W_data_4bit(GPS[k]); Delay1KTCYx(100); }
}//while
} //end main |
 |
|
|
cmathiaz
India
13 Posts |
Posted - 03 oct. 2007 : 10:27:42
|
From your code, it appears that you are trying to interface a PIC microcontroller to a GPS serial port. So far, in your code, you seem to have just read $GPSGGA NMEA string data into the buffer GPS[]. Now you will have parse the buffer string data to extract Lat and Long values. You might want to look at the source code for the Movmap3D program for more details (listed in the "Off-road" forum). Good luck!
cmathiaz |
Edited by - cmathiaz on 03 oct. 2007 10:28:53 |
 |
|
|
flaiba
Argentina
6 Posts |
Posted - 13 oct. 2010 : 20:22:01
|
I'm testing Gps Tracker TK 102. I did the following steps:
1)SMS: begin123456 Answer: BEGIN ok! 2)SMS: admin123456 myPhone Answer: ADMIN ok! 3)I called and it answered lat, lon, etc. 4)SMS: adminip123456 myIP myPort Answer: ADMINIP ok! 5)SMS: apn123456 internet.gprs.unifon.com.ar Answer: APN ok! 6)SMS: apnuser123456 wap Answer: APNUSER ok! 7)SMS: apnpasswd123456 wap Answer: APNPASSWD ok! 8)SMS: t030s***n123456 Answer: T030S***N ok!
I have my own TCP Server application listening on myIP and myPort, that shows everything that enters. It works well, I tried sending data through Telnet, but don't enter anything from the TK102. Can anyone tell me whats wrong?
How can I ask the TK102 a geo position by software?
Thanks, Marcela.
|
 |
|
|
kuelbrease3
1 Posts |
Posted - 29 déc. 2010 : 10:12:14
|
| Hi! I just bought a Magellan Roadmate 800 from a friend, so it's second hand (or maybe it was third hand). I've located the manual online and downloaded it, but until I have time to pour over 100+ pages, is there a "quick start guide" with basic instructions, and possibly even visuals??? I'm not very technical and am not good with "gadgets", but have a road trip this week end that I'd like to use the GPS on. Any help would be greatly appreciated! Thanks~ |
 |
|
| |
Topic  |
|
|
|
| This page was generated in 0,61 seconds. |
 |
|