Open rharbird opened 5 years ago
Hello,
I may be mis-using the API but I don't seem to be able to retain the background colour. Can you help? Here is some sample code:
let outString2 = "" let total_litres = 0 let outString1 = "" function buildString22() { outString1 = "Flow Measurement" outString2 = "Total today (l): " + total_litres } radio.onReceivedNumber(function (receivedNumber) { total_litres = Math.round(receivedNumber / 1000) }) function displayString22() { LCD1IN8.LCD_Clear() LCD1IN8.DisString( 0, 0, outString1, LCD1IN8.Get_Color(LCD_COLOR.RED) ) LCD1IN8.DisString( 0, 10, outString2, LCD1IN8.Get_Color(LCD_COLOR.RED) ) LCD1IN8.LCD_Display() } LCD1IN8.LCD_Init() LCD1IN8.LCD_Clear() LCD1IN8.LCD_SetBL(5) LCD1IN8.LCD_Filling(LCD1IN8.Get_Color(LCD_COLOR.BLUE)) LCD1IN8.DisString( 21, 21, "Flow Measurement", LCD1IN8.Get_Color(LCD_COLOR.RED) ) LCD1IN8.LCD_Display() radio.setGroup(44) radio.setTransmitPower(7) basic.forever(function () { buildString22() displayString22() basic.pause(2000) })
Hello,
I may be mis-using the API but I don't seem to be able to retain the background colour. Can you help? Here is some sample code:
let outString2 = "" let total_litres = 0 let outString1 = "" function buildString22() { outString1 = "Flow Measurement" outString2 = "Total today (l): " + total_litres } radio.onReceivedNumber(function (receivedNumber) { total_litres = Math.round(receivedNumber / 1000) }) function displayString22() { LCD1IN8.LCD_Clear() LCD1IN8.DisString( 0, 0, outString1, LCD1IN8.Get_Color(LCD_COLOR.RED) ) LCD1IN8.DisString( 0, 10, outString2, LCD1IN8.Get_Color(LCD_COLOR.RED) ) LCD1IN8.LCD_Display() } LCD1IN8.LCD_Init() LCD1IN8.LCD_Clear() LCD1IN8.LCD_SetBL(5) LCD1IN8.LCD_Filling(LCD1IN8.Get_Color(LCD_COLOR.BLUE)) LCD1IN8.DisString( 21, 21, "Flow Measurement", LCD1IN8.Get_Color(LCD_COLOR.RED) ) LCD1IN8.LCD_Display() radio.setGroup(44) radio.setTransmitPower(7) basic.forever(function () { buildString22() displayString22() basic.pause(2000) })