Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | Re: Re: BX-24 & DS-GPM

Discussion forum for the BasicX family of microcontroller chips.

BX-24 & DS-GPM - Kara - Mar 22 7:27:36 2007

i'm working on a project to try and get a BX-24 to read the registers
of a DS-GPM. i found a sample code for the microcontroller to output
the data to an LCD but i want to send it back to the PC via the serial
cable instead & eliminat the LCD.

my "debug.Print" commands are returning a syntax error....

the sample code is from totalrobots.co.uk....

can anyone help.... please?



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: BX-24 & DS-GPM - Chris - Mar 22 12:53:14 2007

If you post the offending line of code we can help you.
Chris

----- Original Message -----
From: "Kara"
To:
Sent: Thursday, March 22, 2007 2:31 AM
Subject: [BasicX] BX-24 & DS-GPM
> i'm working on a project to try and get a BX-24 to read the registers
> of a DS-GPM. i found a sample code for the microcontroller to output
> the data to an LCD but i want to send it back to the PC via the serial
> cable instead & eliminat the LCD.
>
> my "debug.Print" commands are returning a syntax error....
>
> the sample code is from totalrobots.co.uk....
>
> can anyone help.... please?
> Yahoo! Groups Links
>



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: BX-24 & DS-GPM - Kara - Mar 23 7:30:46 2007

i know nobody wants to see an entire code but instead of tryin to
explain where each part is coming from i thought it easier to simply
post the whole code.

the error is occuring in the "Read_Registers" sub-routine....

any help would be great. Thanks a million.
dim icom3 (1 to 50) as byte
dim ocom3 (1 to 50) as byte
dim data3 (1 to 50) as byte
'****************************
Public sub main ()
do
Debug.Print "GPS System"
call Setup_GPM
call Signal_Quality
call Read_Registers
'call Read_GPS
loop
end sub
'**************************
Public sub Setup_GPM()
call openqueue(icom3,50)
call openqueue(ocom3,50)
call definecom3(19,20,bx1000_1000)
call opencom(3,9600,icom3,ocom3)
end sub
'**************************
Public sub Signal_Quality()
delay (0.5)
Debug.Print "GPS quality is:"
IF (data3(20)=0) then
Debug.Print "Bad. No Signal"
ElseIf (data3(20)=1) then
Debug.Print "Good Signal"
Else
Debug.Print "No Reading"
end if
delay(0.5)
end sub
'************************
Public sub Read_GPS()
'Debug.Print(ocom3,"[" & Chr(209) & Chr(129) & "]" & "]")
delay(0.5)
call getqueue(icom3,data3,29)
sleep(20)
end sub
'************************
Public sub Read_Registers ()
delay(0.5)

Debug.Print "Position & Altitude"
'Debug.Print (ocom3,"Lat=" & CStr(data3(3)) & CStr(data3(4)) & ":" &
CStr(data3(5)) & CStr(data3(6)) & " :" & CStr(data3(7)) & CStr(data3
(8)) & CStr(data3(9)) & CStr(data3(10)))
delay(0.5)

'Debug.Print (ocom3,"Lon=" & CStr(data3(11)) & CStr(data3(12)) & CStr
(data3(13)) & " :" & CStr(data3(14)) & CStr(data3(15)) & " :" & CStr
(data3(16)) & CStr(data3(17)) & CStr(data3(18) & CStr(data3(19))))
delay(0.5)

'Debug.Print (ocom3, "Alt=" & CStr(data3(26)) & CStr(data3(27)) & CStr
(data3(28)) & CStr(data3(29)) & "m")
delay(0.5)
end sub
'************************



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: BX-24 & DS-GPM - Tom Becker - Mar 23 8:19:37 2007


> Debug.Print (ocom3,"Lat=" ...

This syntax is not valid. Debug.Print cannot be directed to COM3; it
sends strings solely to COM1 (like: Debug.Print "Bad. No Signal") as a
coding diagnostic tool.

Try using PutQueue and PutQueueStr.
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: BX-24 & DS-GPM - Kara - Mar 23 15:49:17 2007

is there a way to print the data in the debug window? that's what i
need....

the original code has the "PutQueueStr" commands and i tried to
replace them with the Debug.Print so i can read the coordinates with
using an LCD...

any suggestions?

> > Debug.Print (ocom3,"Lat=" ...
>
> This syntax is not valid. Debug.Print cannot be directed to COM3; it
> sends strings solely to COM1 (like: Debug.Print "Bad. No Signal") as a
> coding diagnostic tool.
>
> Try using PutQueue and PutQueueStr.
> Tom
>



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: BX-24 & DS-GPM - "nje...@ihug.co.nz" - Mar 23 16:37:03 2007

Also
You are defining the com3 port every time thru the main loop.
you only need do this once.
neil

Tom Becker wrote:

>
> > Debug.Print (ocom3,"Lat=" ...
>
> This syntax is not valid. Debug.Print cannot be directed to COM3; it
> sends strings solely to COM1 (like: Debug.Print "Bad. No Signal") as a
> coding diagnostic tool.
>
> Try using PutQueue and PutQueueStr.
>
> Tom
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.5.446 / Virus Database: 268.18.13/726 - Release Date: 18/03/2007 3:34 p.m.
>
>


(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: BX-24 & DS-GPM - Tom Becker - Mar 23 17:53:03 2007


> ... is there a way to print the data in the Debug window? That's
what I need...

Do you mean that you need to print received data during development?
One way you might do that is to use the IDE (File/Capture...) to
capture the data to a text file, close it, then print the file with a
utility like Notepad. You can also highlight and copy anything in the
IDE using Windows commands, then print that.
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: BX-24 & DS-GPM - kara kent - Mar 24 11:08:55 2007

hiya Tom, first off... thanks for gettin back to me.

ok i'll explain what i'm doin:
i've built a robot for a final year university project. i'm puttin the GPS unit on it as a means of navigation.
the GPS will read it's position and return coordinates to the BX-24. when the stamp recieves these coordinates i'd like for them to appear on my laptop screen in real time for debugging purposes.
the BX-24 will then compare current location with destination and drive accordingly. so as you can see i need to have the coordinates appearing on my screen, hence me needing to use a "debug.print..." command.....

i really hope you can help cos i'm really in big trouble with this. thanks a million

Tom Becker wrote:
> ... is there a way to print the data in the Debug window? That's
what I need...

Do you mean that you need to print received data during development?
One way you might do that is to use the IDE (File/Capture...) to
capture the data to a text file, close it, then print the file with a
utility like Notepad. You can also highlight and copy anything in the
IDE using Windows commands, then print that.

Tom

---------------------------------
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.

[Non-text portions of this message have been removed]


(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: BX-24 & DS-GPM - Tom Becker - Mar 24 14:11:20 2007

> ... I'd like for them to appear on my laptop screen in real time...

I think I see several problems in your code, Kara:
- you don't want to reopen queues each main loop iteration; move the
Main() Do down below Call Setup_GPM;
- don't you want to call Read_GPS (gets data from the GPS) before
Read_Registers (displays data)?;
- in sub Read_GPS, you can't send the command to COM3 using
Debug.Print; try using PutQueueStr instead, like this:
dim strGPSCmd as string
strGPSCmd = "[" & Chr(209) & Chr(129) & "]" & "]"
call PutQueueStr(ocom3, strGPSCmd) ;
- in sub Read_Registers, remove the ocom3 references in each Debug.Print.

That should get you closer.
Tom


(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: BX-24 & DS-GPM - rosa...@aol.com - Mar 24 23:16:04 2007

Hi,

Why you don't use one of the pin as a com3, send the information to your PC and then use Hyper terminal to see the information coming from the BX-24.

rosarite

-----Original Message-----
From: c...@yahoo.co.uk
To: b...@yahoogroups.com
Sent: Sat, 24 Mar 2007 9:08 AM
Subject: Re: [BasicX] Re: BX-24 & DS-GPM

hiya Tom, first off... thanks for gettin back to me.

ok i'll explain what i'm doin:
i've built a robot for a final year university project. i'm puttin the GPS unit on it as a means of navigation.
the GPS will read it's position and return coordinates to the BX-24. when the stamp recieves these coordinates i'd like for them to appear on my laptop screen in real time for debugging purposes.
the BX-24 will then compare current location with destination and drive accordingly. so as you can see i need to have the coordinates appearing on my screen, hence me needing to use a "debug.print..." command.....

i really hope you can help cos i'm really in big trouble with this. thanks a million

Tom Becker wrote:
> ... is there a way to print the data in the Debug window? That's
what I need...

Do you mean that you need to print received data during development?
One way you might do that is to use the IDE (File/Capture...) to
capture the data to a text file, close it, then print the file with a
utility like Notepad. You can also highlight and copy anything in the
IDE using Windows commands, then print that.

Tom

---------------------------------
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.

[Non-text portions of this message have been removed]

________________________________________________________________________
AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
[Non-text portions of this message have been removed]


(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: BX-24 & DS-GPM - kara kent - Mar 26 10:24:27 2007

hiya Tom. thanks for all that advice. most of it seems ok so far, not throwing up errors so far. however that particular suggestion below is throwing back a syntax error just after the Debug.Print command in the line.

sorry to be continually bothering you about this, but again thanks so much!!!!

you suggested strGPSCmd along with PutQueueStr in one of the previous subroutines..... would that same thing work again here?

- in sub Read_Registers, remove the ocom3 references in each Debug.Print.

_

---------------------------------
All New Yahoo! Mail – Tired of unwanted email come-ons? Let our SpamGuard protect you.

[Non-text portions of this message have been removed]


(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: BX-24 & DS-GPM - Tom Becker - Mar 26 10:50:06 2007

> ... you suggested strGPSCmd along with PutQueueStr in one of the previous subroutines... would that same thing work again here?

If you mean to ask if PutQueueStr can be used instead of Debug.Print to
send to COM1, and thus to the IDE monitor, yes, but you'd need to define
queues for, and open, COM1 first.

You can use Debug.Print to display on COM1 (but not COM3). Try this:

Debug.Print "Lat=" & CStr(data3(3)) & CStr(data3(4)) & ":" &
CStr(data3(5)) & CStr(data3(6)) & " :" & CStr(data3(7)) & CStr(data3
(8)) & CStr(data3(9)) & CStr(data3(10))
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )