Skip to content

Instantly share code, notes, and snippets.

@dmiddlecamp
Created August 2, 2019 13:13
Show Gist options
  • Select an option

  • Save dmiddlecamp/3e94918eef9c8e2c8900139587f8df34 to your computer and use it in GitHub Desktop.

Select an option

Save dmiddlecamp/3e94918eef9c8e2c8900139587f8df34 to your computer and use it in GitHub Desktop.

Revisions

  1. dmiddlecamp created this gist Aug 2, 2019.
    28 changes: 28 additions & 0 deletions gps_antenna_switch.ino
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@

    #define STARTING_LATITUDE_LONGITUDE_ALTITUDE NULL
    uint8_t internalANT[]={0xB5,0x62,0x06,0x13,0x04,0x00,0x00,0x00,0xF0,0x7D,0x8A,0x2A};
    uint8_t externalANT[]={0xB5,0x62,0x06,0x13,0x04,0x00,0x01,0x00,0xF0,0x7D,0x8B,0x2E};


    ...

    setup() {


    // select internal antenna
    //antennaSelect(internalANT);
    antennaSelect(externalANT);

    }



    void antennaSelect(uint8_t *buf){
    for(uint8_t i=0;i<12;i++)
    {
    Serial1.write(buf[i]); //send the command to gps module
    Serial.print(buf[i],HEX);
    Serial.print(",");
    }
    Serial.println("");
    }