Tinyclr MOD-GPS modified code

Just placed an order at proto-pic.co.uk.

Okay, gps is ordered, now i am busy with the code… gps code is near ready. but need to adjust the code for the car.

Question;
North = 0 or 360 degrees.
South = 180 degrees.

When i am heading about 270 degrees (=east) and the bearing (target destination) is 280, the difference is -10 (270-280), so i know when the number is negative, need to go left.
When i am heading 270 degrees, and the bearing is 260, i know the car needs to go to the right, difference is +10 (270-260), the number is positive.
But. When i am heading 350 (almost north), and the new bearing is 5, calculate this, 350-5 = +345, in my current code, the car thinks, he needs to go right, but the bearing is near to hist left.

How do i solve this?

Thanks!

if greater than 180, then you can “get” there in the opposite direction.

Not always, if you have a heading of 170 and your bearing is 190, is difference of -20,is left, don’t get the opposite direction.

Thinking, thinking, thinking…

Or do you mean, when the difference is greater then 180, get the opposite direction?

yes, the difference.

-360 to -180 means right turn 360+X degrees
-180 to 0 means left turn X degrees
0 to 180 means right turn X degress
180 to 360 means left turn 360-X degrees

The way to do this is do Error = Error - 360, for all values of error.

This will make error in the range of -180 < Error < 180, and make it behave how you want it to.

Thank you!

They just deliverd the GPS. Now i need some solder-stuff to assemble the wires :S

That’s pretty simple. It should not be hard.
I will add you on MSN, so you can ask questions if needed. :wink:

MSN?? I haven’t installed MSN for years :wink:

Just bought the solder-stuff, now it’s time to assamble! woohoo ;D

Lol, we spent hours on MSN two years ago or so. :smiley:
your address was colin@ cre8ion ?

Good luck, if you need help just ask :wink:

Foekie, you’re right, i remember :wink: I helped you couple if times with rs232 connections :slight_smile:

Just soldered the wires. It’s time to check the connection :smiley:

Haha. You mean “with my very bad visual basic hexapod application” lol :smiley:
That was when I started programming :-[

Cool. Don’t forget to post the driver + a video 8)

Hexapod, lol, yeah 8)

Driver could be nice :wink: Video is awesome!
Will post video as soon my first test drive is done :smiley:

Another question. What does this mean (pops up every 20 secs):

[quote]GC: 3msec 27336 bytes used, 37044 bytes available
Type 0F (STRING ): 120 bytes
Type 11 (CLASS ): 2616 bytes
Type 12 (VALUETYPE ): 120 bytes
Type 13 (SZARRAY ): 2268 bytes
Type 15 (FREEBLOCK ): 37044 bytes
Type 16 (CACHEDBLOCK ): 120 bytes
Type 17 (ASSEMBLY ): 16992 bytes
Type 18 (WEAKCLASS ): 48 bytes
Type 19 (REFLECTION ): 24 bytes
Type 1B (DELEGATE_HEAD ): 396 bytes
Type 1D (OBJECT_TO_EVENT ): 168 bytes
Type 1E (BINARY_BLOB_HEAD ): 660 bytes
Type 1F (THREAD ): 768 bytes
Type 20 (SUBTHREAD ): 96 bytes
Type 21 (STACK_FRAME ): 612 bytes
Type 27 (FINALIZER_HEAD ): 264 bytes
Type 31 (IO_PORT ): 216 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
Type 36 (APPDOMAIN_ASSEMBLY ): 1776 bytes[/quote]

That’s the garbage collector.
You can disable it by adding the following code inside your main method:

Debug.EnableGCMessages(false); 

Good luck :wink:

w000000000000000000000000000000t

GPS IS WORKING!

Cannot read coordinates at the moment, pc inside, need gps outside :S

How i know i got signal?

            while (FEZ_Objects.GPS.IsValid() == false)
            {
                Thread.Sleep(5000);
                GPS_Utility.GetLocation();
            }

            //
            // Start Flashing
            //
            FEZ_Objects.FlashLED.Start();

So, the onboad LED is going to flash when gps got signal :wink:

Tomorrow is the big test. on a big clear parking lot, get the 4 corners as coordinates, and let the car drive. i allready programmed the code last few weeks.

To be continued

Cool! I am curious now ;D

If you’re using the GPGLL setence, you can use the last field, which will show as A, V or D when you have a lock, it will give N or something like that when you don’t have a valid lock - google it.

Yes, a question left: which sentence are you using anyway?