O Watch
Published © MIT

Getting Started with O Watch

Assemble the O Watch, configure the Arduino IDE and load your first program.

BeginnerFull instructions provided1 hour1,336
Getting Started with O Watch

Things used in this project

Hardware components

O Watch Base Kit
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

O Watch Demo

Arduino
//-------------------------------------------------------------------------------
//  O Watch Basic Example
//  Last Updated 17 February 2016
//  
//  This is just a basic demo of O Watch
//
//-------------------------------------------------------------------------------

#include <TinyScreen.h>
#include <SPI.h>
#include <Wire.h>

uint8_t amtcolors=7;
uint8_t colors[]={TS_8b_Black,TS_8b_Blue,TS_8b_Red,TS_8b_Green,TS_8b_White,TS_8b_Yellow,TS_8b_Brown};

uint8_t i=0;
  
uint8_t nextColor()
{
  if(i>=amtcolors)i=0;
  return colors[i++];
}

TinyScreen display = TinyScreen(TinyScreenPlus);

void setup(void) 
{
  Wire.begin();
  display.begin();
  display.setFlip(1);
  display.setFont(liberationSans_10ptFontInfo);
}

void loop() 
{
  display.clearWindow(0,0,96,64);
  for(int i=5;i<800;i++)
  {
    int x=(3000-(i*5))%90;
    int y=(i*14)%60;
    int width=((i*7)%(90-x));
    int height=((6000-(i*6))%(60-y));
    display.drawRect(x,y,constrain(width,5,20),constrain(height,5,15),i&1,nextColor());
    display.fontColor(TS_8b_White,TS_8b_Black);
    display.setCursor(5,25);
    display.print("   O   W a t c h   ");
    if(i<10)
      delay(40);
    if(i<50)
      delay(40);
  }
  delay(50);
  display.clearWindow(0,0,96,64);
}

TinyScreen+ Library

C/C++
No preview (download only).

Credits

O Watch

O Watch

9 projects • 15 followers
Make your own smartwatch. Learn 3D design and Arduino coding.

Comments