This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot:examples:matrix [2021/03/05 00:31] – heiko.pikner | en:iot:examples:matrix [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Needed libraries: | Needed libraries: | ||
| - | < | + | < |
| For learning how to use the IoT Matrix you can try out the example and tasks. | For learning how to use the IoT Matrix you can try out the example and tasks. | ||
| Line 16: | Line 16: | ||
| #include < | #include < | ||
| #include < | #include < | ||
| + | #include < | ||
| MLED matrix(7); //set intensity=7 (maximum) | MLED matrix(7); //set intensity=7 (maximum) | ||
| Line 40: | Line 41: | ||
| {{: | {{: | ||
| - | Tic-Tac-Toe | + | Trips-traps-trull |
| <code c> | <code c> | ||
| Line 47: | Line 48: | ||
| #include < | #include < | ||
| #include < | #include < | ||
| + | #include < | ||
| MLED matrix(7); | MLED matrix(7); | ||
| Line 83: | Line 85: | ||
| {{: | {{: | ||
| - | Make everything covered one by one in a circular way | + | Ringiratast ekraani täitmine |
| <code c> | <code c> | ||
| Line 90: | Line 92: | ||
| #include < | #include < | ||
| #include < | #include < | ||
| + | #include < | ||
| MLED matrix(7); | MLED matrix(7); | ||
| Line 98: | Line 101: | ||
| } | } | ||
| - | int drawRight(int a, int b, int c) { | + | void drawRight(int a, int b, int c) { |
| for (int i = c; i <= a+c; i++) { | for (int i = c; i <= a+c; i++) { | ||
| matrix.drawRect(i, | matrix.drawRect(i, | ||
| Line 106: | Line 109: | ||
| } | } | ||
| - | int drawDown(int a, int b) { | + | void drawDown(int a, int b) { |
| for (int i = b; i <= a; i++) { | for (int i = b; i <= a; i++) { | ||
| matrix.drawRect(a, | matrix.drawRect(a, | ||
| Line 114: | Line 117: | ||
| } | } | ||
| - | int drawLeft(int a, int b) { | + | void drawLeft(int a, int b) { |
| int e = 0; | int e = 0; | ||
| for (int i = 0; i <= a; i++) { | for (int i = 0; i <= a; i++) { | ||
| Line 124: | Line 127: | ||
| } | } | ||
| - | int drawUp(int a, int b, int c) { | + | void drawUp(int a, int b, int c) { |
| for (int i = 0; i <= a; i++) { | for (int i = 0; i <= a; i++) { | ||
| matrix.drawRect(c, | matrix.drawRect(c, | ||