-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDigit.h
76 lines (63 loc) · 1.69 KB
/
Digit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/***************************************************
*
*
*
*
This is and additional library for using Morphing Digit on P10 dotmatrix display using DMD3 library.
DMD3 library original by Mr. Aziz Kurosaki.
Morphing Digit original library Mr. Hari Wiguna , @HariFun/hwiguna on https://github.com/hwiguna/HariFun_165_Morphing_Digits
*
*
*
*
Ported and adjusted for p10 single color dmd,, by.Bram Ibe. visit and support the webblog at https://arduinosoreang.blogspot.com
and youtube channel bram ibe ....
Thank u..
All text above must be included in any redistribution
****************************************************/
#ifndef DIGIT_H
#define DIGIT_H
#include <Arduino.h>
#include "Bitmap.h"
#include "DMD3.h"
class DMD3;
class Bitmap;
class Digit
{
public:
Digit(Bitmap* d, DMD3* f,byte value, int pixel, uint16_t xo, uint16_t yo, uint16_t color);
void Draw(byte value);
void Morph(byte newValue);
byte Value();
void DrawColon(uint16_t c);
void swap();
void clear();
void swapcopy();
void loop();
private:
DMD3* _disp;
Bitmap* _display;
byte _value;
uint16_t _color;
uint16_t xOffset;
uint16_t yOffset;
int segHeight;
int segWidth;
int animSpeed = 20;
void drawPixel(uint16_t x, uint16_t y, uint16_t c);
void drawFillRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t c);
void drawLine(uint16_t x, uint16_t y, uint16_t x2, uint16_t y2, uint16_t c);
void drawSeg(byte seg);
void Morph2();
void Morph3();
void Morph4();
void Morph5();
void Morph6();
void Morph7();
void Morph8();
void Morph9();
void Morph0();
void Morph1();
void repeat();
};
#endif