-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bbefd4
commit 4218352
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
####################################### | ||
# Syntax Coloring Map | ||
####################################### | ||
|
||
####################################### | ||
# Datatypes (KEYWORD1) | ||
####################################### | ||
|
||
Digit KEYWORD1 | ||
|
||
####################################### | ||
# Methods and Functions (KEYWORD2) | ||
####################################### | ||
|
||
display KEYWORD2 | ||
|
||
####################################### | ||
# Variables (KEYWORD3) | ||
####################################### | ||
|
||
pin1 KEYWORD3 | ||
pin2 KEYWORD3 | ||
|
||
###################################### | ||
# Constants (LITERAL1) | ||
####################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name=Digit | ||
version=1.0.0 | ||
author=Simon Pucheu | ||
maintainer=Simon Pucheu | ||
sentence=None | ||
paragraph=None | ||
category=Sensors | ||
url=https://github.com/IngeniumTeam/Digit | ||
architectures=avr | ||
includes=Digit.h | ||
depends= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <Arduino.h> | ||
|
||
#include "Digit.h" | ||
|
||
Digit::Digit(uint8_t iPin1, uint8_t iPin2, int brightness = 5) | ||
{ | ||
pin1 = iPin1; | ||
pin2 = iPin2; | ||
pinMode(pin1, OUTPUT); | ||
pinMode(pin2, OUTPUT); | ||
digit = TM1637Display(pin1, pin2); | ||
digit.setBrightness(brightness); | ||
} | ||
|
||
/** | ||
* Display a number on the digit display | ||
*/ | ||
void Digit::display(int number) | ||
{ | ||
digit.showNumberDec(number, true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <Arduino.h> | ||
#include <TM1637Display.h> | ||
|
||
class Digit | ||
{ | ||
public: | ||
Digit(uint8_t iPin1, uint8_t iPin2, int brightness = 5); | ||
void display(int number); | ||
uint8_t pin1; | ||
uint8_t pin2; | ||
TM1637Display digit = TM1637Display(0, 0); | ||
}; |