Page 241 - Build Your Own Quadcopter_ Power Up Your Designs with the Parallax Elev-8
P. 241

220     Bu il d  Y o ur  O w n  Q u a d c o p t e r


                                 xb1.Str(String(“,”))
                                 fv := GPS.Long_Hour                       ‘ Get Hour
                                 If fv <> floatNaN
                                   xb1.Dec(GPS.Long_Hour)
                                 Else
                                   xb1.Str(String(“---”))

                                 xb1.Str(String(“,”))
                                 fv := GPS.Long_Minute                     ‘ Get Minute
                                 If fv <> floatNaN
                                   xb1.Dec(GPS.Long_Minute)
                                 Else
                                   xb1.Str(String(“---”))

                                 xb1.Str(String(“,”))
                                 fv := GPS.Long_Second                     ‘ Get Second
                                 If fv <> floatNaN
                                   xb1.Dec(GPS.Long_Second)
                                 Else
                                   xb1.Str(String(“---”))
                                 xb1.tx(13)
                                 WaitCnt(ClkFreq / 2 + ClkFreq / 4 + Cnt)  ‘ Wait .75 seconds to
                             repeat

                             DAT
                                floatNaN       LONG $7FFF_FFFF             ‘Means Not a Number

                                The above program uses the same XBee driver object, XBee_Object_1, as was the case in
                             the previous test programs. This program also uses a GPS driver object named GPS_Float_
                             Lite that takes care of all the necessary protocols between the GPS module and the Mini.
                             Retrieving data from the GPS module becomes very easy, since all that is required is to call
                             the GPS driver method that returns the desired data. For example, the following gets the
                             current GPS hour data:

                             fv := GPS.Long_Hour

                             Where fv is a local variable, GPS is the local reference to GPS_Float_Lite, and Long_Hour is
                             the name of the method in GPS_Float_Lite that returns the current GPS UTC hour value.
                             UTC is short for Coordinated Universal Time and is the time standard used to ensure that GPS
                             time reports become independent of any time zone.
                                Except for the deployed display, the receive portion of this system is the same as the one
                             previously described in the test system. I used the BOE with the laptop to test the prototype
                             system, which made sense because the portable display would not impact any essential data
                             transfers between the transmitter and receiver XBee nodes. The receiver-node connections
                             were detailed in Table 8.8, and the assembly was shown in Figure 8.23. Figure 8.27 is a laptop
                             screenshot showing the results of a trial run with the complete GPS system. The 10 data
                             elements displayed in the figure are detailed in Table 8.10 for your information. GPS data is
   236   237   238   239   240   241   242   243   244   245   246