It has been more than month since Open Source Bluetooth Watch Initiative first announced.There has been some improvements.Hardware side of the project completed.But there is a lot to do on the software side to make it a nice developer-friendly watch.So i started programming an API for the watch.But this last month has been very very busy for me.But still there has been somethings done.
Hardware Updates :
5 pushbuttons added for navigation.
Tilt-Sensor added.
Software Updates:
I designed watch UI on top of Vertical Screens called Widgets.In these Widgets, we’ve got buttons , labels etc.
There still some lacks & issues to solved.As soon as i have some free time i will work on those and release source code with Android & Maemo Apps. to talk to watch.If there is anything about the code that is bothering you please dont hesitate to comment or contact me .Suggestions are welcome.
Here is a scheme of the Class Structure:
Example Arduino Code :
#include "LCD.h"
#include "ui.h"
LCD lcd;
Widget Multimedia("Multimedia");
Widget Alerts("Alerts");
Label play("Play / Pause",false,"1");
Label stop1("Stop",false,"2");
Label prev("Prev",false,"3");
Label next("Next",false,"4");
Label mcalls("Missed Calls",false);
Label messages("Messages",false);
Label mail("Mail",false);
Label update("Update",false,"5");
Input in(0,1);
UI Screen(&lcd);
void setup()
{
DDRD |= B01111100; // Set SPI pins as output
PORTD |= B01111100; // Set SPI pins HIGH
Serial.begin(115200);
lcd.init();
delay(500);
lcd.SetRect(0,0,131,131,FILL,WHITE);
Multimedia.addLabel(&play);
Multimedia.addLabel(&stop1);
Multimedia.addLabel(&prev);
Multimedia.addLabel(&next);
Screen.addHorizontal(&Multimedia);
Alerts.addLabel(&mcalls);
Alerts.addLabel(&messages);
Alerts.addLabel(&mail);
Alerts.addLabel(&update);
Screen.addHorizontal(&Alerts);
}
void loop()
{
in.checkInput();
switch(in.label)
{
case 0:
SerialSender("0");
break;
case 1:
Screen.vCursor-=1;
Screen.redraw=true;
break;
case 2:
Screen.vCursor+=1;
Screen.redraw=true;
break;
case 3:
Screen.hCursor-=1;
Screen.redraw=true;
break;
case 4:
Screen.activeLabel->Click();
break;
case 5:
Screen.hCursor+=1;
Screen.redraw=true;
break;
}
Screen.vCursor=max(0,min(3,Screen.vCursor));
Screen.hCursor=max(-1,min(1,Screen.hCursor));
Screen.draw();
delay(100);
}