|
2 | 2 | #include <SmingCore/SmingCore.h>
|
3 | 3 | #include <Libraries/Adafruit_PCD8544/Adafruit_PCD8544.h>
|
4 | 4 |
|
5 |
| -// Software SPI (slower updates, more flexible pin options): |
6 |
| - // pin 7 - Serial clock out (SCLK) |
7 |
| - // pin 6 - Serial data out (DIN) |
8 |
| - // pin 5 - Data/Command select (D/C) |
9 |
| - // pin 4 - LCD chip select (CS) |
10 |
| - // pin 3 - LCD reset (RST) |
11 |
| -Adafruit_PCD8544 display = Adafruit_PCD8544(14, 13, 12, 5, 4); |
| 5 | +// GPIO13/D7 - Serial clock out (SCLK) |
| 6 | +// GPIO12/D6 - Serial data out (DIN) |
| 7 | +// GPIO14/D5 - Data/Command select (D/C) |
| 8 | +// GPIO5/D1 - LCD chip select (CS) |
| 9 | +// GPIO4/D2 - LCD reset (RST) |
| 10 | +Adafruit_PCD8544 display = Adafruit_PCD8544(13, 12, 14, 5, 4); |
| 11 | + |
| 12 | + |
12 | 13 | void displayTest()
|
13 | 14 | {
|
14 | 15 | display.begin();
|
15 |
| - // init done |
16 |
| - |
17 |
| - // you can change the contrast around to adapt the display |
18 |
| - // for the best viewing! |
19 |
| - display.setContrast(10); |
20 |
| - |
21 |
| - display.display(); // show splashscreen |
22 |
| - delay(200); |
23 |
| - display.clearDisplay(); // clears the screen and buffer |
24 |
| - |
25 |
| - display.setRotation(4); // rotate 90 degrees counter clockwise, can also use values of 2 and 3 to go further. |
26 |
| - display.setTextSize(1); |
27 |
| - display.setTextColor(BLACK); |
28 |
| - display.setCursor(0,0); |
29 |
| - display.println("Sming"); |
30 |
| - display.setTextSize(2); |
31 |
| - display.println("Example!"); |
32 |
| - display.display(); |
| 16 | + display.setContrast(10); |
| 17 | + display.display(); // show splashscreen |
| 18 | + delay(2000); |
| 19 | + display.clearDisplay(); // no changes will be visible until display() is called |
| 20 | + display.setRotation(4); // rotate 90 degrees counter clockwise, can also use values of 2 and 3 to go further. |
| 21 | + display.setTextSize(1); |
| 22 | + display.setTextColor(BLACK); |
| 23 | + display.setCursor(0, 0); |
| 24 | + display.println("Sming"); |
| 25 | + display.setTextSize(2); |
| 26 | + display.println("Example"); |
| 27 | + display.display(); |
33 | 28 | }
|
| 29 | + |
34 | 30 | void init()
|
35 | 31 | {
|
36 |
| - Serial.begin(SERIAL_BAUD_RATE); // 115200 by default |
37 |
| - Serial.systemDebugOutput(true); // Enable debug output to serial |
38 |
| - |
39 |
| - WifiStation.enable(false); |
40 |
| - WifiAccessPoint.enable(true); |
41 |
| - |
| 32 | + Serial.begin(SERIAL_BAUD_RATE); |
42 | 33 | displayTest();
|
43 | 34 | }
|
44 |
| - |
0 commit comments