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

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


                                The transmit code was modified to transmit only the four GPS data elements discussed
                             above. I also eliminated the commas between the data elements to conserve space on the
                             LCD display. The modified transmit program named GPS_XBee_Brief is shown below.

                             {{
                             GPS_XBee_Brief
                             Modified !GPS_Propeller program by D. J. Norris 2013
                             This program controls an Elev-8 Quadcopter real-time data system
                             This brief edition transmits only four data elements:
                               Latitude
                               Longitude
                               Speed
                               Altitude

                             Pin connections:
                               Transmitter:
                                  XBee DOUT to P7
                                  XBee DIN  to P6
                                  GPS Rx    to P8
                                  GPS Tx    to P9
                               Receiver:
                                  XBee DOUT to P7
                                  XBee DIN  to P6
                             }}
                             CON
                               _clkmode   = xtal1 + pll16x
                               _xinfreq   = 5_000_000

                               XB_Rx      = 7    ‘ XBee DOUT
                               XB_Tx      = 6    ‘ XBee DIN
                               XB_Baud    = 9600
                               CR         = 13   ‘ Carriage Return value
                               GPS_Pin    = 8
                             OBJ
                                GPS       : “GPS_Float_Lite”
                                FS        : “FloatString”
                                xb1       : “XBee_Object_1”

                             Pub  Start | fv
                             xb1.start(XB_Rx, XB_Tx, 0, XB_Baud)          ‘ Initialize comms for
                                                                                    XBee
                             xb1.AT_Init
                             xb1.AT_ConfigVal(string(“ATMY”),8)
                             xb1.AT_ConfigVal(string(“ATDL”),9)
                             GPS.Init
   240   241   242   243   244   245   246   247   248   249   250