-
Notifications
You must be signed in to change notification settings - Fork 0
/
Matrix9.h
51 lines (45 loc) · 1.36 KB
/
Matrix9.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
// MaxMatrix Version 1.0 Feb 2013 Copyright 2013 Oscar Kin-Chung Au
// OttDIY Arduino Project, 2020
#ifndef _Otto_Matrix9_H_
#define _Otto_Matrix9_H_
#include "Arduino.h"
#include "Gestures9.h"
#define max7219_reg_noop 0x00
#define max7219_reg_digit0 0x01
#define max7219_reg_digit1 0x02
#define max7219_reg_digit2 0x03
#define max7219_reg_digit3 0x04
#define max7219_reg_digit4 0x05
#define max7219_reg_digit5 0x06
#define max7219_reg_digit6 0x07
#define max7219_reg_digit7 0x08
#define max7219_reg_decodeMode 0x09
#define max7219_reg_intensity 0x0a
#define max7219_reg_scanLimit 0x0b
#define max7219_reg_shutdown 0x0c
#define max7219_reg_displayTest 0x0f
class Otto_Matrix {
private:
byte data;
byte load;
byte clock;
byte num;
byte buffer[8];
byte CHARbuffer[80];
int rotation;
void reload();
char rotation2;
public:
Otto_Matrix();
void init(byte data, byte load, byte clock, byte num, int rotation);
void clearMatrix();
void setCommand(byte command, byte value);
void setIntensity(byte intensity);
void setColumn(byte col, byte value);
void setColumnAll(byte col, byte value);
void setDot(byte col, byte row, byte value);
void writeFull(unsigned long value);
void sendChar(const byte data, byte pos, byte number, byte scrollspeed);
};
#endif
//end