You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,34 +15,38 @@ With minimal changes in configuration settings it shall support other LCD resolu
15
15
16
16
The library supports:
17
17
1. Two image formats:
18
-
-- Normal GFX (first pixel is top left corner, represented by bit0 in the first byte)
19
-
-- Native NKK (first pixel is top right corner, represented by bit7 in the first byte, as per NKK specs)
18
+
- Normal GFX (first pixel is top left corner, represented by bit0 in the first byte)
19
+
- Native NKK (first pixel is top right corner, represented by bit7 in the first byte, as per NKK specs)
20
20
2. Landscape (64x32) and Portrait (32x64) display configurations
21
21
3. Two formats for background colour - three bytes RGB format and native NKK format (RRGGBBxx)
22
22
4. A rotation of an image by 180 degrees to accommodate different possible footprints of an NKK device on your pcb.
23
23
24
24
## Library usage:
25
25
1. Create a NKK_SmartDisplayLCD object. At this step specify:
26
-
- w: The NKK LCD screen width in pixels. Maximum w is 256 and Maximum w x h/8 = 65535 for this library code.
27
-
- h: The NKK LCD screen height in pixels Maximum h is 256 and Maximum w x h/8 = 65535 for this library code.
28
-
- isRotate180: A flag to indicate that the picture need to be rotated by 180 degrees to accommodate different possible footprints of an NKK device on your pcb. Applied just before the picture is uploaded to the NKK device by the *display()* or *display_NKK()* functions.
29
-
- cspin: Slave Select(Chip Select) signal (to allow use more than one NKK device with their own SS signals).
30
-
- freqSPI: SPI frequency, Hz.
31
-
- pointer: A reference (pointer) to native SPI object which handles SPI communications.
26
+
- w: The NKK LCD screen width in pixels. Maximum w is 256 and Maximum w x h/8 = 65535 for this library code.
27
+
- h: The NKK LCD screen height in pixels Maximum h is 256 and Maximum w x h/8 = 65535 for this library code.
28
+
- isRotate180: A flag to indicate that the picture need to be rotated by 180 degrees to accommodate different possible footprints of an NKK device on your pcb. Applied just before the picture is uploaded to the NKK device by the *display()* or *display_NKK()* functions.
29
+
- cspin: Slave Select(Chip Select) signal (to allow use more than one NKK device with their own SS signals).
30
+
- freqSPI: SPI frequency, Hz.
31
+
- pointer: A reference (pointer) to native SPI object which handles SPI communications.
32
+
32
33
2. Execute *begin()* method. That would start SPI interface and reset the NKK device.
34
+
33
35
3. Set required background colour and brightness:
34
-
- By using library methods that would communicate directly to the NKK device:
36
+
- By using library methods that would communicate directly to the NKK device:
35
37
```C++
36
38
setColourNKK(byte data); // set as per NKK specs (RRGGBBxx)
37
39
setColourRGB(byte R, byte G, byte B); // RGB get converted to the closest colour as per NKK specs (64 colours available)
38
40
setBrightness(byte data); //set as per NKK specs (BBBxxxxx)
39
41
```
40
-
- By setting library variables *bkgColour* and *bkgBrightnes* which will be used when the *display()* and *display_NKK()* methods are called
42
+
- By setting library variables *bkgColour* and *bkgBrightnes* which will be used when the *display()* and *display_NKK()* methods are called
41
43
42
44
4. Set an image in a GFX or NKK format to library variables *imageBufferGFX[]* and *imageBufferNKK[]*. No need to set both.
43
45
You can use an NKK Bitmap bilder (MS Excel file) in the */documentation* folder to build an image in GFX or NKK formats, landscape or portrait.
46
+
44
47
5. Use *drawPixel(x,y,color)* to set a pixel in the *imageBufferGFX[]*. X and Y are pixel coordunates, starting from 0. For this monochrome
45
48
LCD display *color* can be any value, it will be converted either 0 or 1 in the library. This method is also used for integration with Adafruit_GFX library (https://github.com/adafruit/Adafruit-GFX-Library).
49
+
46
50
6. Execute *display()* or *display_NKK()* methods which will do the following:
47
51
- upload an image to the NKK device from *imageBufferGFX[]* or *imageBufferNKK[]* and make the image visible.
48
52
*display()* will use *imageBufferGFX[]* as a source and will overwrite *imageBufferNKK[]*.
0 commit comments