Skip to content

Commit a44d0f6

Browse files
authored
Merge pull request #12 from canchebagur/add-docs
Add docs folder
2 parents 4c0d1fb + fce674c commit a44d0f6

File tree

2 files changed

+223
-0
lines changed

2 files changed

+223
-0
lines changed

docs/api.md

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# Arduino MKR RGB library
2+
3+
## Methods
4+
5+
### `begin()`
6+
7+
Initialize the matrix device.
8+
9+
#### Syntax
10+
11+
```
12+
MATRIX.begin()
13+
```
14+
15+
#### Parameters
16+
17+
None.
18+
19+
#### Returns
20+
21+
1 on success, 0 on failure.
22+
23+
#### Example
24+
25+
```
26+
if (!MATRIX.begin()) {
27+
Serial.println("Failed to initialize the display!");
28+
while (1);
29+
}
30+
```
31+
32+
#### See also
33+
34+
* [end()](#end)
35+
* [brightness()](#brightness)
36+
* [beginDraw()](#beginDraw)
37+
* [endDraw()](#endDraw)
38+
* [set()](#set)
39+
40+
### `end()`
41+
42+
Stops the matrix device.
43+
44+
#### Syntax
45+
46+
```
47+
MATRIX.end()
48+
```
49+
50+
#### Parameters
51+
52+
None.
53+
54+
#### Returns
55+
56+
None.
57+
58+
#### Example
59+
60+
```
61+
MATRIX.end();
62+
```
63+
64+
#### See also
65+
66+
* [begin()](#begin)
67+
* [brightness()](#brightness)
68+
* [beginDraw()](#beginDraw)
69+
* [endDraw()](#endDraw)
70+
* [set()](#set)
71+
72+
### `brightness()`
73+
74+
Set the brightness of the matrix.
75+
76+
#### Syntax
77+
78+
```
79+
MATRIX.brightness(brightness)
80+
```
81+
82+
#### Parameters
83+
84+
* _brightness_: matrix brightness value to set, 0 to 255.
85+
86+
#### Returns
87+
88+
None.
89+
90+
#### Example
91+
92+
```
93+
MATRIX.brightness(10);
94+
```
95+
96+
#### See also
97+
98+
* [begin()](#begin)
99+
* [end()](#end)
100+
* [beginDraw()](#beginDraw)
101+
* [endDraw()](#endDraw)
102+
* [set()](#set)
103+
104+
### `beginDraw()`
105+
106+
Begins a drawing operation.
107+
108+
#### Syntax
109+
110+
```
111+
MATRIX.beginDraw()
112+
```
113+
114+
#### Parameters
115+
116+
None.
117+
118+
#### Returns
119+
120+
None.
121+
122+
#### Example
123+
124+
```
125+
MATRIX.beginDraw();
126+
MATRIX.set(0, 0, 255, 0, 0); // x position, y position, red value, green value, blue value
127+
MATRIX.endDraw();
128+
```
129+
130+
#### See also
131+
132+
* [begin()](#begin)
133+
* [end()](#end)
134+
* [brightness()](#brightness)
135+
* [endDraw()](#endDraw)
136+
* [set()](#set)
137+
138+
### `endDraw()`
139+
140+
Ends a drawing operation.
141+
142+
#### Syntax
143+
144+
```
145+
MATRIX.endDraw()
146+
```
147+
148+
#### Parameters
149+
150+
None.
151+
152+
#### Returns
153+
154+
None.
155+
156+
#### Example
157+
158+
```
159+
MATRIX.beginDraw();
160+
MATRIX.set(0, 0, 255, 0, 0); // x position, y position, red value, green value, blue value
161+
MATRIX.endDraw();
162+
```
163+
164+
#### See also
165+
166+
* [begin()](#begin)
167+
* [end()](#end)
168+
* [brightness()](#brightness)
169+
* [beginDraw()](#beginDraw)
170+
* [set()](#set)
171+
172+
### `set()`
173+
174+
Set a matrix pixel's color value.
175+
176+
#### Syntax
177+
178+
```
179+
MATRIX.set(x,y,r,g,b)
180+
```
181+
182+
#### Parameters
183+
184+
* _x_: x position of the pixel.
185+
* _x_: y position of the pixel.
186+
* _r_: red color value (o to 255) of the pixel.
187+
* _g_: green color value (o to 255) of the pixel.
188+
* _b_: blue color value (o to 255) of the pixel.
189+
190+
#### Returns
191+
192+
None.
193+
194+
#### Example
195+
196+
```
197+
MATRIX.beginDraw();
198+
MATRIX.set(1, 1, 0, 255, 0); // x position, y position, red value, green value, blue value
199+
MATRIX.endDraw();
200+
```
201+
202+
#### See also
203+
204+
* [begin()](#begin)
205+
* [end()](#end)
206+
* [brightness()](#brightness)
207+
* [beginDraw()](#beginDraw)
208+
* [endDraw()](#endDraw)

docs/readme.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Arduino MKR RGB library
2+
3+
4+
The Arduino MKR RGB library allows you to draw on the MKR RGB Shield using some very basic functions. This library is also the software interface necessary to create more complex graphics using the ArduinoGraphics Library.
5+
6+
This library is the one you should use to create the object _YourScreen_ that you find in the examples of the ArduinoGraphics library. You may choose any label for your matrix objetct as far as you use that label instead of _YourScreen_ label.
7+
8+
To use this library:
9+
10+
```
11+
#include <ArduinoGraphics.h>
12+
#include <Arduino_MKRRGB.h>
13+
```
14+
15+
> **Note: Arduino MKR RGB library depends of the ArduinoGraphics library**.

0 commit comments

Comments
 (0)