stickyBUG Code

The following sample code requires the segmentBUG library.

Source Code


// import libraries...
#include <Wire.h>
#include "segmentBUG.h"

// 7 segment object...
segmentBUG segment = segmentBUG();

// program setup...
void setup() {
   segment.begin(SEGMENT_BUG_ADDRESS);
}

// main program loop...
void loop() {

   // if you want to display dots, then you need to write
   // each digit individually and set "dot" to true..
   segment.writeDigitNum(0, 0, true);   // thousands
   segment.writeDigitNum(1, 0, true);   // hundreds
   segment.drawColon(true);             // colon
   segment.writeDigitNum(3, 0, true);   // tens
   segment.writeDigitNum(4, 0, true);   // units
   segment.writeDisplay();
   delay(10);
}