This is a library for Arduino to display numbers on a 7 segment display.
Go to file
Xaloc 6824ce9f3a add on off functions 2020-03-13 17:25:31 +01:00
LICENSE fix license to nonalcoholic 2020-03-13 12:36:31 +01:00
README.md standarize pins, update readme 2020-03-13 16:41:20 +01:00
keywords.txt add on off functions 2020-03-13 17:25:31 +01:00
segNums.cpp add on off functions 2020-03-13 17:25:31 +01:00
segNums.h add on off functions 2020-03-13 17:25:31 +01:00

README.md

7seg_numbers_arduino

This is a library for Arduino to display numbers on a 7 segment display. The library creates a display object, this object is initialized by passing an array of the pin numbers where each segment is connected. It is assumed that the pins array will have the following order: {pinA, pinB, pinC, pinD, pinE, pinF, pinG, pinDP}.

Once the object is created, to print a number use the function with the number's name. Here is an example that use the library to print all the numbers from 0 to 9 and then the DP.

#include <segNums.h>

int pins[8] = {2,3,4,5,6,7,8,9};

SegDisp disp(pins);

void setup(){
}

void loop(){
  disp.zero(1);
  delay(500);
  disp.zero(0);
  delay(500);
  disp.one(1);
  delay(500);
  disp.one(0);
  delay(500);
  disp.two(1);
  delay(500);
  disp.two(0);
  delay(500);
  disp.three(1);
  delay(500);
  disp.three(0);
  delay(500);
  disp.four(1);
  delay(500);
  disp.four(0);
  delay(500);
  disp.five(1);
  delay(500);
  disp.five(0);
  delay(500);
  disp.six(1);
  delay(500);
  disp.six(0);
  delay(500);
  disp.seven(1);
  delay(500);
  disp.seven(0);
  delay(500);
  disp.eight(1);
  delay(500);
  disp.eight(0);
  delay(500);
  disp.nine(1);
  delay(500);
  disp.nine(0);
  delay(500);
  disp.dot(1);
  delay(500);
  disp.dot(0);
  delay(500);
}