Things used in this project

Hardware components:
Watch%20single
O Watch Sensor Kit
×1

Code

BMP280 DemoArduino
/***************************************************************************
  This is a demo of the BMP280 humidity, temperature & pressure sensor
  for the O Watch. http://theowatch.com 
  
  Made on products from http://tiny-circuits.com
  
  Derived from the BMP280 library  test program by Adafruit 
  ----> http://www.adafruit.com/products/2651

  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing products
  from Adafruit!

  Original library and example written by Limor Fried & Kevin Townsend for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution

 ***************************************************************************/

#include <Adafruit_BMP280.h> //include the Adafruit BMP280 library
#include <TinyScreen.h> //required for all O Watch programs
#include <SPI.h> //required for interfacing with OLED screen
#include <Wire.h> //required for communicating with sensor board via I2C 

TinyScreen display = TinyScreen(TinyScreenPlus);

//Initialize the library using I2C 
Adafruit_BMP280 bme; // I2C is the interface used in TinyScreen+ for all sensors
  
void setup() 
{
  display.begin();
  display.setBrightness(8);
  display.setFlip(1);
  display.setCursor(5,5);
  display.setFont(liberationSans_8ptFontInfo);
  display.fontColor(TS_8b_White,TS_8b_Black);
  if (!bme.begin()) //check if you are able to read the sensor
  {  
    display.print("Not valid BMP280");
    while (1);
  }
}
  
void loop() {
    display.setCursor(5,5);
    display.print("Temp = ");
    //call library function to reach temp value and converting it to farenheit
    display.print((bme.readTemperature()*9/5+32-13)); 
    display.print(" *F");
    display.setCursor(5,25);
    display.print("Pr = ");
    //call library function to reach pressure value
    display.print(bme.readPressure()/3389.39); 
    display.print(" inHg.");
    display.setCursor(5,45);
    display.print("Alt = ");
    //call library function to calculate altitude from pressure
    display.print(bme.readAltitude(1020.8)); // this should be adjusted to your local forcase
    display.print(" m  ");
    delay(2000);
    display.clearWindow(0,0,96,64);
}

Credits

Owatchlogofebsmall
O Watch

Make your own smartwatch. Learn 3D design and Arduino coding.

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

D Watch
Intermediate
  • 614
  • 8

Full instructions

First attempt at extending O Watch sample code to include display of Temp (in C and F) and RH.

Flappy Birds on O Watch
Intermediate
  • 139
  • 1

Learn how you can add Flappy Birds game on your O Watch.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback