From a46524de60b9db077d3840be5df5df04768c9400 Mon Sep 17 00:00:00 2001 From: LowPowerLab Date: Fri, 18 Dec 2015 15:11:42 -0500 Subject: [PATCH] decrease SPI clock speed for 5110 LCD --- Examples/MightyHat/MightyHat.ino | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Examples/MightyHat/MightyHat.ino b/Examples/MightyHat/MightyHat.ino index 61ebfa2..a4c1173 100644 --- a/Examples/MightyHat/MightyHat.ino +++ b/Examples/MightyHat/MightyHat.ino @@ -207,7 +207,7 @@ void clearDisplay() { } void refreshLCD() { - + SPI.setClockDivider(SPI_CLOCK_DIV16); byte lcdwidth = lcd.getWidth(); byte lcdheight = lcd.getHeight(); char c; @@ -280,6 +280,7 @@ void refreshLCD() { lcd.drawXBMP(0, lcdheight-xbmp_rssi_height, xbmp_rssi_width, xbmp_rssi_height, bmpPtr); lcd.drawStr(xbmp_rssi_width+1, 48, RSSIstr); } while(lcd.nextPage()); + SPI.setClockDivider(SPI_CLOCK_DIV4); } //******************************************** END LCD FUNCTIONS ******************************************************************************** @@ -643,14 +644,12 @@ void loop() { newPacketReceived = true; } - //boolean newBatteryReading=false; - //if (readBattery()) newBatteryReading = true; readBattery(); - - if (newPacketReceived /*|| newBatteryReading*/) + if (newPacketReceived) { newPacketReceived = false; refreshLCD(); } + LCD_BACKLIGHT(batteryLow); } \ No newline at end of file