background image

      myFile.println("--------------------------------------------------------------------------
-----------"); 
    } 
    myFile.close(); // Close the file to properly save the data 
  } 
  else { 
    // if the file didn't open, print an error: 
    Serial.println("error opening data.txt"); 
  } 
 

 
void loop()  

  char gpsDate[10], gpsTime[10]; 
  //Query module only every 10 seconds. Adjust this value for more/less frequent GPS logs. 
  if (millis() - lastTime > 10000) 
  { 
    lastTime = millis(); //Update the timer 
    long latitude = myGPS.getLatitude(); 
    long longitude = myGPS.getLongitude(); 
    long altitude = myGPS.getAltitude(); 
    uint8_t fixType = myGPS.getFixType(); 
    if(fixType != 0){ 
      myFile = SD.open("data.txt", FILE_WRITE); // Open file "data.txt" 
      if(myFile) 
      { 
        // Get date and time 
      sprintf(gpsDate,"%d/%d/%d", myGPS.getMonth(),myGPS.getDay(),myGPS.getYear()); 
      if(myGPS.getSecond() < 10){ 
        sprintf(gpsTime,"%d/%d/0%d", myGPS.getHour(),myGPS.getMinute(),myGPS.getSecond()); 
      } 
      else 
      { 
        sprintf(gpsTime,"%d/%d/0%d", myGPS.getHour(),myGPS.getMinute(),myGPS.getSecond()); 
      } 
      // Save data to SD card 
      myFile.print(gpsDate); 
      myFile.print('\t'); 
      myFile.print(gpsTime); 
      myFile.print('\t'); 
      myFile.print(latitude); 
      myFile.print('\t'); 
      myFile.print(longitude); 
      myFile.print('\t'); 
      myFile.println(altitude);  
      } 
 
      Serial.print(gpsDate); 
      Serial.print('\t'); 
      Serial.print(gpsTime); 
      Serial.print('\t'); 
      Serial.print(latitude); 
      Serial.print('\t'); 

Summary of Contents for DEV-16829

Page 1: ...wiic connector on the board as well as a dedicated power pin for non Qwiic peripherals such as serial UART or SPI devices so you can pick and choose when to power the peripherals you are monitoring th...

Page 2: ...some Qwiic breakouts to your MicroMod project you ll want at least one Qwiic cable to connect it all together Below are some options for both of those cables SparkFun MicroMod Artemis Processor DEV 16...

Page 3: ...u want to send your weather data via a wireless signal eg Bluetooth or WiFi There s a MicroMod processor for that Looking to instead maximize efficiency and processing power You guessed it there s a M...

Page 4: ...e on your Carrier Board USB C Connector Connect to your computer to program your Processor Board and also can provide power to your MicroMod system 3 3V Regulator Provides a regulated 3 3V and sources...

Page 5: ...nserve power in battery powered applications The G1 3V3 line is controlled by G1 on the MicroMod Processor and the G2 3 3V circuit is as you may suspect is controlled by G2 on the MicroMod Processor T...

Page 6: ...t pin on the M 2 Connector Refer to your Processor Board s documentation for information on how to properly define that pin in your code A UART PTH header connects to RX1 and TX1 for serial data loggi...

Page 7: ...is jumper to probe the current draw at the 3 3V output of the regulator For help measuring current take a look at our How to Use a Multimeter tutorial CLOSED Bypass BYP The penny in the fuse jumper By...

Page 8: ...monstrate using these two mounts for a Qwiic breakout in the following section Hardware Assembly Now that we re familiar with the hardware on the MicroMod Data Logging Carrier Board it s time to plug...

Page 9: ...will not match up if the Processor Board is not plugged in entirely Data Logging Peripherals As we mentioned previously the Data Logging Carrier Board offers several ways to connect your sensors or ot...

Page 10: ...vers you already have installed you may need to install drivers for your processor board Refer to your Processor Board s Hookup Guide for detailed instructions on how to install them At this point you...

Page 11: ...he GPS Antenna to the board using a u Fl to SMA Adapter If you ve never worked with u Fl connectors before this tutorial offers a few quick tips for using them Also the SparkFun u blox Arduino library...

Page 12: ...Connect to the Ublox module using Wire port Serial println F Ublox GPS not detected at default I2C address Please check wiring Freezi ng while 1 myGPS setI2COutput COM_TYPE_UBX Set the I2C port to out...

Page 13: ...myGPS getFixType if fixType 0 myFile SD open data txt FILE_WRITE Open file data txt if myFile Get date and time sprintf gpsDate d d d myGPS getMonth myGPS getDay myGPS getYear if myGPS getSecond 10 s...

Page 14: ...view over serial Power Control Examples In addition to this GPS example we ve written two example sketches specifically for the Data Logging Carrier Board demonstrating how to control the 3 3V regula...

Page 15: ...oject The tutorials below may give you some ideas to get the creative juices flowing GPS Logger Shield Hookup Guide How to assemble and hookup the SparkFun GPS Logger Shield Never lose track of your A...

Page 16: ...from external Qwiic enabled I2C devices Some of these Qwiic enabled devices include GPS GNSS modules pressure altitude humidity temperature air quality environment distance and weight sensors...

Reviews: