Skip to content

Commit

Permalink
2.5.0 - External number matrix
Browse files Browse the repository at this point in the history
This update makes the large variable numMatrix, which contains all the characters so they can be displayed on a screen, an external variable in a seperate file called 7seg_matrix.h
  • Loading branch information
BlaT2512 committed Dec 1, 2019
1 parent bf628a0 commit fffa30f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=sevenSegment
version=2.4.1
version=2.5.0
author=Blake Tourneur <[email protected]>
maintainer=Blake Tourneur <[email protected]>
sentence=Control infinite seven segment displays with your arduino!
Expand Down
66 changes: 66 additions & 0 deletions src/7seg_matrix.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const int sevenSegment::_numMatrix[62][8] PROGMEM {
//segments
//g,f,e,d,c,b,a,dp
{0,1,1,1,1,1,1,0}, //ZERO
{0,0,0,0,1,1,0,0}, //ONE
{1,0,1,1,0,1,1,0}, //TWO
{1,0,0,1,1,1,1,0}, //THREE
{1,1,0,0,1,1,0,0}, //FOUR
{1,1,0,1,1,0,1,0}, //FIVE
{1,1,1,1,1,0,1,0}, //SIX
{0,0,0,0,1,1,1,0}, //SEVEN
{1,1,1,1,1,1,1,0}, //EIGHT
{1,1,0,1,1,1,1,0}, //NINE
{1,1,1,0,1,1,1,0}, //LETTER A
{1,1,1,1,1,0,0,0}, //LETTER B
{0,1,1,1,0,0,1,0}, //LETTER C
{1,0,1,1,1,1,0,0}, //LETTER D
{1,1,1,1,0,0,1,0}, //LETTER E
{1,1,1,0,0,0,1,0}, //LETTER F
{0,1,1,1,1,0,1,0}, //LETTER G
{1,1,1,0,1,0,0,0}, //LETTER H
{0,1,1,0,0,0,0,0}, //LETTER I
{0,0,1,1,1,1,0,0}, //LETTER J
{1,1,1,0,1,0,1,0}, //LETTER K
{0,1,1,1,0,0,0,0}, //LETTER L
{0,0,1,0,1,0,1,0}, //LETTER M
{0,1,1,0,1,1,1,0}, //LETTER N
{0,1,1,1,1,1,1,0}, //LETTER O
{1,1,1,0,0,1,1,0}, //LETTER P
{1,1,0,0,1,1,1,0}, //LETTER Q
{0,1,1,0,0,1,1,0}, //LETTER R
{1,1,0,1,1,0,1,0}, //LETTER S
{1,1,1,1,0,0,0,0}, //LETTER T
{0,1,1,1,1,1,0,0}, //LETTER U
{0,1,0,1,1,1,0,0}, //LETTER V
{0,1,0,1,0,1,0,0}, //LETTER W
{1,1,1,0,1,1,0,0}, //LETTER X
{1,1,0,1,1,1,0,0}, //LETTER Y
{1,0,0,1,0,1,1,0}, //LETTER Z
{0,0,0,0,0,0,0,0}, //BLANK
{0,1,0,0,0,1,0,0}, //CHARACTER "
{0,1,1,0,1,1,0,0}, //CHARACTER #
{1,1,0,1,0,0,1,0}, //CHARACTER $
{0,1,0,1,1,0,1,0}, //CHARACTER %
{1,1,1,1,0,1,1,0}, //CHARACTER &
{0,0,0,0,0,1,0,0}, //CHARACTER ' `
{0,1,1,1,0,0,1,0}, //CHARACTER ( [ {
{0,0,0,1,1,1,1,0}, //CHARACTER ) ] }
{1,1,0,0,0,1,1,0}, //CHARACTER *
{1,1,1,0,0,0,0,0}, //CHARACTER +
{0,0,0,1,1,0,0,0}, //CHARACTER ,
{1,0,0,0,0,0,0,0}, //CHARACTER - ~
{1,0,0,0,0,1,0,0}, //CHARACTER /
{1,0,0,1,0,0,0,0}, //CHARACTER :
{1,0,0,1,1,0,0,0}, //CHARACTER ;
{1,1,0,0,0,0,1,0}, //CHARACTER <
{1,0,0,0,0,0,1,0}, //CHARACTER =
{1,0,0,0,0,1,1,0}, //CHARACTER >
{1,0,1,0,0,1,1,0}, //CHARACTER ?
{1,0,1,1,1,1,1,0}, //CHARACTER @
{1,1,0,0,0,0,0,0}, //CHARACTER (back slash)
{0,1,0,0,0,1,1,0}, //CHARACTER ^
{0,0,0,1,0,0,0,0}, //CHARACTER _
{0,0,0,0,0,1,0,1}, //CHARACTER !
{0,0,0,0,0,0,0,1} //CHARACTER .
};
68 changes: 1 addition & 67 deletions src/sevenSegment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,7 @@

#include "Arduino.h"
#include "sevenSegment.h"

const int sevenSegment::_numMatrix[62][8] PROGMEM {
//segments
//g,f,e,d,c,b,a,dp
{0,1,1,1,1,1,1,0}, //ZERO
{0,0,0,0,1,1,0,0}, //ONE
{1,0,1,1,0,1,1,0}, //TWO
{1,0,0,1,1,1,1,0}, //THREE
{1,1,0,0,1,1,0,0}, //FOUR
{1,1,0,1,1,0,1,0}, //FIVE
{1,1,1,1,1,0,1,0}, //SIX
{0,0,0,0,1,1,1,0}, //SEVEN
{1,1,1,1,1,1,1,0}, //EIGHT
{1,1,0,1,1,1,1,0}, //NINE
{1,1,1,0,1,1,1,0}, //LETTER A
{1,1,1,1,1,0,0,0}, //LETTER B
{0,1,1,1,0,0,1,0}, //LETTER C
{1,0,1,1,1,1,0,0}, //LETTER D
{1,1,1,1,0,0,1,0}, //LETTER E
{1,1,1,0,0,0,1,0}, //LETTER F
{0,1,1,1,1,0,1,0}, //LETTER G
{1,1,1,0,1,0,0,0}, //LETTER H
{0,1,1,0,0,0,0,0}, //LETTER I
{0,0,1,1,1,1,0,0}, //LETTER J
{1,1,1,0,1,0,1,0}, //LETTER K
{0,1,1,1,0,0,0,0}, //LETTER L
{0,0,1,0,1,0,1,0}, //LETTER M
{0,1,1,0,1,1,1,0}, //LETTER N
{0,1,1,1,1,1,1,0}, //LETTER O
{1,1,1,0,0,1,1,0}, //LETTER P
{1,1,0,0,1,1,1,0}, //LETTER Q
{0,1,1,0,0,1,1,0}, //LETTER R
{1,1,0,1,1,0,1,0}, //LETTER S
{1,1,1,1,0,0,0,0}, //LETTER T
{0,1,1,1,1,1,0,0}, //LETTER U
{0,1,0,1,1,1,0,0}, //LETTER V
{0,1,0,1,0,1,0,0}, //LETTER W
{1,1,1,0,1,1,0,0}, //LETTER X
{1,1,0,1,1,1,0,0}, //LETTER Y
{1,0,0,1,0,1,1,0}, //LETTER Z
{0,0,0,0,0,0,0,0}, //BLANK
{0,1,0,0,0,1,0,0}, //CHARACTER "
{0,1,1,0,1,1,0,0}, //CHARACTER #
{1,1,0,1,0,0,1,0}, //CHARACTER $
{0,1,0,1,1,0,1,0}, //CHARACTER %
{1,1,1,1,0,1,1,0}, //CHARACTER &
{0,0,0,0,0,1,0,0}, //CHARACTER ' `
{0,1,1,1,0,0,1,0}, //CHARACTER ( [ {
{0,0,0,1,1,1,1,0}, //CHARACTER ) ] }
{1,1,0,0,0,1,1,0}, //CHARACTER *
{1,1,1,0,0,0,0,0}, //CHARACTER +
{0,0,0,1,1,0,0,0}, //CHARACTER ,
{1,0,0,0,0,0,0,0}, //CHARACTER - ~
{1,0,0,0,0,1,0,0}, //CHARACTER /
{1,0,0,1,0,0,0,0}, //CHARACTER :
{1,0,0,1,1,0,0,0}, //CHARACTER ;
{1,1,0,0,0,0,1,0}, //CHARACTER <
{1,0,0,0,0,0,1,0}, //CHARACTER =
{1,0,0,0,0,1,1,0}, //CHARACTER >
{1,0,1,0,0,1,1,0}, //CHARACTER ?
{1,0,1,1,1,1,1,0}, //CHARACTER @
{1,1,0,0,0,0,0,0}, //CHARACTER (back slash)
{0,1,0,0,0,1,1,0}, //CHARACTER ^
{0,0,0,1,0,0,0,0}, //CHARACTER _
{0,0,0,0,0,1,0,1}, //CHARACTER !
{0,0,0,0,0,0,0,1} //CHARACTER .
};
#include "7seg_matrix.h"

sevenSegment::sevenSegment(int sega, int segb, int segc, int segd, int sege, int segf, int segg, bool cathode){
pinMode(sega, OUTPUT);
Expand Down

0 comments on commit fffa30f

Please sign in to comment.