A while back I bought a pair of QDSP-6064 LED bubble displays. I didn’t know much of what I wanted to do with them, but I did know I wanted to make a wrist watch. The project was shevled until I learned EagleCAD, but here are the notes, code and CAM files for you to be able to make one yourself.
Core Components Needed
1. ATMEGA-328P and related components
2. A QDSP-6064 Bubble Display
Let’s get it on
Solder it up, and flash it!
#include <TimeLib.h>
#include <Time.h>
#include "SevSeg.h"
//date --date="-5 hours" +T%s\n > /dev/ttyACM0//Create an instance of the object.SevSegmyDisplay;//Create global variablesunsignedlongtimer;unsignedlongblinker;unsignedlongdisplaysleep;booleanblinkdisplay=true;booleandisplaypower=true;booleanbuttonActive=false;booleanlongPressActive=false;booleanconfighours=true;longbuttonTimer=0;longlongPressTime=1000;time_tt=now();intbutton=A5;booleantimeset=false;#define TIME_HEADER "T"
#define TIME_REQUEST 7
voidsetup(){pinMode(button,INPUT);intdisplayType=COMMON_CATHODE;//Your display is either common cathode or common anodeSerial.begin(9600);//This pinout is for a bubble dispaly//Declare what pins are connected to the GND pins (cathodes)intdigit1=8;//Pin 1intdigit2=5;//Pin 10intdigit3=11;//Pin 4intdigit4=13;//Pin 6//Declare what pins are connected to the segments (anodes)intsegA=7;//Pin 12intsegB=6;//Pin 11intsegC=10;//Pin 3intsegD=3;//Pin 8intsegE=9;//Pin 2intsegF=4;//Pin 9intsegG=2;//Pin 7intsegDP=12;//Pin 5intnumberOfDigits=4;myDisplay.Begin(displayType,numberOfDigits,digit1,digit2,digit3,digit4,segA,segB,segC,segD,segE,segF,segG,segDP);myDisplay.SetBrightness(100);timer=millis();blinker=millis();displaysleep=millis()+10000;setSyncProvider(requestSync);Serial.println("Waiting for sync message");}voidloop(){if(((signedlong)(millis()-timer))>0){timer=millis()+1000;Serial.println(displaysleep);}chartempString[10];//Used for sprintfsprintf(tempString,"%02d%02d",hour(now()),minute(now()));if(blinkdisplay==true){displaysleep=millis()+10000;if(((signedlong)(millis()-blinker))>0){if(displaypower==true){displaypower=false;}else{displaypower=true;}blinker=millis()+1000;}}else{displaypower=true;}if(((((signedlong)(millis()-displaysleep))<0)&&displaypower==true)){//Serial.println("display put to sleep");//displaypower = false;//} //if (displaypower == true) {myDisplay.DisplayString(tempString,0);}if(digitalRead(button)==HIGH){displaysleep=millis()+10000;if(buttonActive==false){buttonActive=true;buttonTimer=millis();}if((millis()-buttonTimer>longPressTime)&&(longPressActive==false)){longPressActive=true;if(timeset==false){Serial.println("Configuring time");blinkdisplay=true;confighours=!confighours;}else{setTime(now());blinkdisplay=false;Serial.println("Done configuring time");}timeset=!timeset;}}else{//displaysleep = millis()+10000;if(buttonActive==true){if(longPressActive==true){longPressActive=false;}else{if(timeset==true){if(confighours==true){t=now()+3600;}else{t=now()+60;}setTime(t);blinkdisplay=false;}}buttonActive=false;}}if(Serial.available()){processSyncMessage();}}voidprocessSyncMessage(){unsignedlongpctime;constunsignedlongDEFAULT_TIME=0;//1357041600; // Jan 1 2013if(Serial.find(TIME_HEADER)){pctime=Serial.parseInt();if(pctime>=DEFAULT_TIME){// check the integer is a valid time (greater than Jan 1 2013)setTime(pctime);// Sync Arduino clock to the time received on the serial porttimeset=false;blinkdisplay=false;}}}time_trequestSync(){Serial.write(TIME_REQUEST);return0;// the time will be sent later in response to serial mesg}
Ⓒ 1997- Russell Handorf. All other copyrights and trademarks are the property of their respective owners.