44#include < AnalogDeviceAbstraction.h>
55#include < RemoteAuthentication.h>
66#include < RemoteMenuItem.h>
7- #include < Fonts/FreeSans18pt7b.h>
87#include < Fonts/FreeSans9pt7b.h>
98#include < Ethernet.h>
109
@@ -22,8 +21,11 @@ byte mac[] = {
2221 0xDE , 0xAD , 0xBE , 0xEF , 0xFE , 0xED
2322};
2423
25- // we set up a TFT display first using the exact graphics variable used in the designer.
26- Adafruit_ILI9341 gfx (6 , 7 );
24+ #define TFT_CS 6
25+ #define TFT_RST 3
26+ #define TFT_DC 7
27+
28+ Adafruit_ST7735 gfx = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
2729
2830// we also want to customise the colours and menu spacing. So we create this config object too
2931// which we initialise during the setup method.
@@ -56,20 +58,20 @@ EepromAuthenicationInfoMenuItem menuAuthKeyMgr(1002, &authManager, &menuRemoteMo
5658void prepareCustomConfiguration () {
5759 // first we set the spacing around title, items and widgets. The make padding function follows the
5860 // same standard as CSS. Top, right, bottom, left.
59- makePadding (colorConfig.titlePadding , 12 , 5 , 12 , 5 ); // top, right, bottom & left
60- makePadding (colorConfig.itemPadding , 5 , 3 , 6 , 5 ); // top, right, bottom & left
61- makePadding (colorConfig.widgetPadding , 5 , 10 , 0 , 5 );// top, right, bottom & left
61+ makePadding (colorConfig.titlePadding , 6 , 3 , 6 , 3 ); // top, right, bottom & left
62+ makePadding (colorConfig.itemPadding , 3 , 3 , 3 , 3 ); // top, right, bottom & left
63+ makePadding (colorConfig.widgetPadding , 3 , 8 , 0 , 3 );// top, right, bottom & left
6264
6365 // and then the foreground, background and font of the title
6466 colorConfig.bgTitleColor = RGB (50 , 100 , 200 );
6567 colorConfig.fgTitleColor = RGB (0 , 0 , 0 );
66- colorConfig.titleFont = &FreeSans18pt7b ;
68+ colorConfig.titleFont = &FreeSans9pt7b ;
6769 colorConfig.titleBottomMargin = 10 ; // the space between title and items.
6870
6971 // and then the colours for items.
7072 colorConfig.bgItemColor = RGB (0 , 0 , 0 );
7173 colorConfig.fgItemColor = RGB (222 , 222 , 222 );
72- colorConfig.itemFont = &FreeSans9pt7b ;
74+ colorConfig.itemFont = NULL ;
7375
7476 // and when items are selected.
7577 colorConfig.bgSelectColor = RGB (0 , 50 , 200 );
@@ -92,8 +94,8 @@ void prepareCustomConfiguration() {
9294
9395void setup () {
9496 // we are responsible for setting up the initial graphics
95- gfx.begin ( );
96- gfx.setRotation (3 );
97+ gfx.initR (INITR_BLACKTAB );
98+ gfx.setRotation (1 );
9799
98100 // we used an i2c device (io8574) so must initialise wire too
99101 Wire.begin ();
0 commit comments