Reference | All - Docs - Libraries - Soft Processors - Cores

Multiplex7SegSW

setColon ()

Description

This function sets or removes the colon displayed between the second and third digits. It is useful for displaying date or time parameters.

Syntax

setColon(byte value)

Parameters

value: whether the colon is to be set or cleared. A '0' (or false) will remove the colon while a '1' (or true) will set the colon.

Example

(:source:)

  1. include <Multiplex7SegSW>;

byte col = true; byte seconds, minutes, hours;

Multiplex7SegSW sevenseg1;

void setup() {

  sevenseg1.set(1, noOfDigits, digitPins, segmentPins);
  seconds = 0;
  minutes = 0;
  hours = 0;

}

void loop() {

  if (millis() % 500 == 0)
  {
    sevenseg1.setColon(!col);
    ++seconds;
    if (seconds > 120)
    {
      seconds = 0;
      ++minutes;
      if (minutes > 60)
      {
        minutes = 0;
        ++hours;
        if (hours > 12)
        {
          hours = 0;
        }
      }
      sevenseg1.loadValue(hours, 0, 2, ALIGN_RIGHT);
      sevenseg1.loadValue(minutes, 2, 2, ALIGN_RIGHT);
    }
  }
  sevenseg1.update();

}

(:sourceend:)

This text is from the Papilio reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

  

Share |