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
This is a library for **NKK LCD 64x32 SmartDisplay** (https://www.nkkswitches.com/smartdisplay/)
3
+
It has been designed and tested for NKK IS15EBFP4RGB-09YN LCD 64 x 32 Pushbutton and shall work with these models as well:
4
+
S15DBFP4RGB
5
+
IS15DBFP4RGB-09YN
6
+
S15DSBFP4RGB
7
+
IS01DBFRGB
8
+
IS15EBFP4RGB
9
+
IS15ESBFP4RGB
10
+
IS01EBFRGB
11
+
12
+
With minimal changes in configuration settings it shall suppot other LCD resolutions if required.
13
+
14
+
The library supports:
15
+
1. Two image formats:
16
+
-Normal GFX (first pixel is top left corner, represented by bit0 in the first byte)
17
+
-Native NKK (first pixel is top right corner, represented by bit7 in the first byte, as per NKK specs)
18
+
2. Landscape (64x32) and Portrait (32x64) display configurations
19
+
3. Two formats for background colour - three bytes RGB format and native NKK format (RRGGBBxx)
20
+
4. A rotation of an image by 180 degrees to accommodate different possible footprints of an NKK device on your pcb.
21
+
22
+
## Library usage:
23
+
1. Create a NKK_SmartDisplayLCD object. At this step specify:
24
+
w: The NKK LCD screen width in pixels. Maximum w is 256 and Maximum w*h/8 = 65535 for this library code.
25
+
h: The NKK LCD screen height in pixels Maximum h is 256 and Maximum w*h/8 = 65535 for this library code.
26
+
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.
27
+
cspin: Slave Select(Chip Select) signal (to allow use more than one NKK device with their own SS signals).
28
+
freqSPI: SPI frequency, Hz.
29
+
pointer: A reference (pointer) to native SPI object which handles SPI communications.
30
+
31
+
2. Execute *begin()* method. That would start SPI interface and reset the NKK device.
32
+
33
+
3. Set required background colour and brightness:
34
+
- By using library methods that would communicate directly to the NKK device:
35
+
```C++
36
+
setColourNKK(byte data); // set as per NKK specs (RRGGBBxx)
37
+
setColourRGB(byte R, byte G, byte B); // RGB get converted to the closest colour as per NKK specs (64 colours available)
38
+
setBrightness(byte data); //set as per NKK specs (BBBxxxxx)
39
+
```
40
+
- By setting library variables *bkgColour* and *bkgBrightnes* which will be used when the *display()* and *display_NKK()* methods are called
41
+
42
+
4. Set an image in a GFX or NKK format to library variables *imageBufferGFX[]* and *imageBufferNKK[]*. No need to set both.
43
+
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.
44
+
45
+
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
46
+
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).
47
+
48
+
6. Execute *display()* or *display_NKK()* methods which will do the following:
49
+
- upload an image to the NKK device from *imageBufferGFX[]* or *imageBufferNKK[]* and make the image visible.
50
+
*display()* will use *imageBufferGFX[]* as a source and will overwrite *imageBufferNKK[]*.
51
+
*display_NKK()* use *imageBufferNKK[]* as a source and does NOT change *imageBufferGFX[]*.
52
+
AND
53
+
- set NKK device background colour and brightness as per library's variables *bkgColour* and *bkgBrightnes*.
54
+
55
+
*display()* method is also used for integration with Adafruit_GFX library.
56
+
57
+
7. Use other NKK_SmartDisplayLCD library methods like *clearImageBufferGFX()*, *invertImageBufferGFX()* etc to manage content of the image bugger you use.
58
+
59
+
8. Use Adafruit_GFX_Ext object to access to Adafruit_GFX library methods like *setCursor()*, *print()*, *drawPixel()*, *fillRect()* etc to build
60
+
or adjust your image in the *imageBufferGFX[]* image buffer. Do not forget to call *display()* method to transfer your image to the NKK device
61
+
and make it visible.
62
+
63
+
See the examples and descriptions of the library functions provided in the code for more details.
64
+
65
+
66
+
## Known Limitations:
67
+
Requres a native SPI object (like Arduino one) which handles SPI communications.
68
+
With a mimimal changes to the library (an update to the class constructor) it can use
69
+
a separate SPI handler such as https://github.com/adafruit/Adafruit_BusIO
0 commit comments