Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
mvodya committed Jun 28, 2018
1 parent 0d1e0e0 commit 8635a1a
Showing 1 changed file with 39 additions and 3 deletions.
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Matrix8 Library

LED 8x8 Matrix via shift registers.
## LED 8x8 Matrix via shift registers.

![8x8 matrix](https://frogling.com/site/wp-content/uploads/2018/06/DSC_0932.jpg)

Expand All @@ -10,7 +10,43 @@ This library control LED 8x8 matrix via two shift registers (for example 74HC595

* Download all repo files
* Go to arduino IDE root
* Copy all files to library/Matrix8
* Copy all files to `library/Matrix8`
* Just use!

## TODO: examples and documentation
## Simple example

Drawing cross

```cpp
#include "matrix8.h"

// Init matrix8
// latch - 7
// clock - 6
// data - 8
Matrix8 matrix(7, 6, 8);

void setup() {
// Creating two diagonal lines (cross)
for (int i = 0; i < 8; i++) {
matrix.set(i, i, true);
matrix.set(i, 7 - i, true);
}
}

void loop() {
// Loop draw
matrix.draw();
}
```
![8x8 matrix cross](https://frogling.com/site/wp-content/uploads/2018/06/p2212.jpg)
## Functions
* `Matrix8(latch, clock, data)` - init matrix8 constructor
* `Matrix8(latch, clock, data, point to byte buffer)` - init matrix8 with external buffer
* `set(x, y, value)` - set segment value by position
* `draw()` - draw row by row matrix
* `draw(delay)` - draw with delay after rows print, just for test
* `clear()` - clear matrix buffer

0 comments on commit 8635a1a

Please sign in to comment.