Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arduino Wearable Projects

You're reading from  Arduino Wearable Projects

Product type Book
Published in Aug 2015
Publisher
ISBN-13 9781785283307
Pages 218 pages
Edition 1st Edition
Languages

The final sketch


By now you should have your case ready and all your components soldered, so it is time to add the final sketch to the FLORA board. The following sketch is basically a combination of the GPS and OLED sketches we tried out before. Once you are done, you can upload it to the board. If everything is correct, the information should be displayed on the screen:

#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_GPS GPS(&Serial1);

#define OLED_RESET 6
Adafruit_SSD1306 display(OLED_RESET);

void setup()
{
Serial.begin(115200);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  // Clear the buffer.
  display.clearDisplay();
  Serial.println("Testing GPS");

  // 9600 NMEA is the default baud rate for MTK3339
  GPS.begin(9600);

  // Set the update rate of the GPS
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);

  delay(1000);
}

uint32_t timer = millis...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $19.99/month. Cancel anytime}