Z GPSky potřebuji načíst souřadnice pomocí UBX příkazu do paměti (proměnná Reply).
Kód: Vybrat vše
#include <Wire.h> //Needed for I2C to GPS
#include "SparkFun_Ublox_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_Ublox_GPS
SFE_UBLOX_GPS myGPS;
//Compile a UBX data packet to send to GPS
uint8_t Command[] = {0xB5, 0x62, 0x01, 0x02, 0x00, 0x00, 0x03, 0x0A}; // UBX-NAV-POSLLH
uint32_t len = sizeof(Command) / sizeof(uint8_t);
uint8_t Reply[36];
void setup()
{
Serial.begin(115200);
Serial.println("SparkFun Ublox I2C Command Test\n");
Wire.begin();
myGPS.enableDebugging();
if (myGPS.begin() == false)
{
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
while (1);
}
}
void loop()
{
// myGPS.checkUblox(); //See if new data is available. Process bytes as they come in.
if (myGPS.isConnected() == true)
{
Serial.println(F("I2C Connected")); // Just for test
}
myGPS.sendCommand(ubxPacket outgoingUBX, uint16_t maxWait); // CO SEM PŘEDAT ?
delay(250); // To let some time for processing
}