Ben Dixon
Published © GPL3+

GPS OLED Position Display Using XinaBox

I built this project for the fun of it, to display our current GPS coordinates on a small OLED display. Based on Xinabox running an ARM M0+.

BeginnerFull instructions provided6 minutes2,222
GPS OLED Position Display Using XinaBox

Things used in this project

Hardware components

XinaBox CC03 ☒CHIP
☒CHIP 32-bit ARM® Cortex®-M0+ processor
×1
XinaBox SN01 ☒CHIP
☒CHIP GNSS (GPS) receiver
×1
XinaBox OD01 ☒CHIP
☒CHIP 128x64 Pixel OLED Display
×1
XinaBox PL02
☒CHIP 3.7v LiPo battery charger and power supply
×1
XinaBox XC10 ☒BUS Connector
☒BUS connectors
×1
XinaBox IP03 ☒CHIP
☒CHIP interface for SWD, JTAG and SPI programmers with USB port
×1
3.7 V LiPo Battery
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

GPS_Navigator

Arduino
This code is used in an Arduino sketch (.ino file) to run the project.
#include "xCore.h"
#include "xSN01.h"
#include "xOD01.h"

long loop_timing = 0;

void setup() {
  // Start the Serial comms
  Serial.begin(115200);

  // Start the I2C Communication
  Wire.begin();

  //Start OD01
  OLED.begin();

  // Start the Sensor
  SN01.begin();
}

void loop() {
  // Create a variable to store the data read from SN01
  long time = 0;
  long latitude = 0;
  long longitude = 0;
  long altitude = 0;

  // Poll the sensor to read all available data
  SN01.poll();

  // Use a timer to display data once a second
  if ((millis() - loop_timing) > 1000) {


    // Get the time from the GPS
    time = SN01.getTime();

    // Get the latitude from GPS
    latitude = SN01.getLatitude();

    // Get the longitude from GPS
    longitude = SN01.getLongitude();

    // Get the altitude from GPS
    altitude = SN01.getAltitude();

    //Clears the OLED display of OD01
    OD01.clear();

    //Change font size and print header
    OD01.set2X();
    OD01.println("SN01 NAV");
    OD01.set1X();

    // Display the recorded data over the serial monitor
    OD01.print("Time: ");
    OD01.println(time);
    OD01.print("Latitude: ");
    OD01.println((float)latitude/10000000,6);
    OD01.print("Longitude: ");
    OD01.println((float)longitude/10000000,6);
    OD01.print("Altitude: ");
    OD01.println(altitude);

    loop_timing = millis();
  }
}

Credits

Ben Dixon

Ben Dixon

5 projects • 12 followers
I am an electronic engineer with a true love for the art of electronics. I live for anything technology. Yes, I'm a geek just like you!

Comments