Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Arduino Wearable Projects

You're reading from   Arduino Wearable Projects Design, code, and build exciting wearable projects using Arduino tools

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781785283307
Length 218 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Tony Effe A Olsson Tony Effe A Olsson
Author Profile Icon Tony Effe A Olsson
Tony Effe A Olsson
Arrow right icon
View More author details
Toc

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 £13.99/month. Cancel anytime
Visually different images