-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLEDMatrix80x7.cpp
More file actions
63 lines (42 loc) · 852 Bytes
/
LEDMatrix80x7.cpp
File metadata and controls
63 lines (42 loc) · 852 Bytes
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
#include "LEDMatrix80x7.h"
#include <Arduino.h>
LEDMatrix80x7::LEDMatrix80x7()
{
DDRB |= B00111011;
PORTB &= ZEROMASK;
}
LEDMatrix80x7::~LEDMatrix80x7()
{
}
void LEDMatrix80x7::VerticalRefresh()
{
//PORTB &= ZEROMASK;
//analogWrite(10, 250);
for (byte i = 0; i < 8; i++)
{
byte setMask = i << 3;
setMask |= B00000011;
PORTB &= B11000111;
delayMicroseconds(1000); //line off
//here data write 10x8bits for 2 colors (x2)
PORTB = (PORTB & B11000100) | setMask;
delayMicroseconds(100); //line on
//printBits(PORTB);
//Serial.println();
}
}
void LEDMatrix80x7::printBits(int myByte)
{
for (byte mask = 0x80; mask; mask >>= 1) {
if (mask & myByte)
Serial.print('1');
else
Serial.print('0');
}
}
void LEDMatrix80x7::FeedLine(int *lineBytes)
{
for (int8_t i = 0; i < 80; i++)
{
}
}