i am displaying a scrolling text that is usually over 200 characters ,, strange behavior from Mega2560 :
Code: Select all
Const LcdComB as byte = 7
Const LcdComSpeedL as long = 38400
Const LcdMoSiPin as byte = H.1 ' HW7
Const LcdMiSoPin as byte = H.0 ' HW7
Dim LcdEndST as boundedstring(3) = chr(255) & chr(255) & chr(255)
Dim TST as boundedstring(60)
Dim T2ST as boundedstring(250)
Dim iLCD(1 to 100) as byte
Dim oLCD(1 to 500) as byte
Sub Main()
Call OpenQueue(iLcd, SizeOf(iLcd))
Call OpenQueue(oLcd, SizeOf(oLcd))
Call DefineCom(LcdComB, LcdMiSoPin, LcdMoSiPin, &H08)
Call OpenCom(LcdComB, LcdComSpeedL, iLcd, oLcd)
Code :
TST = "rul.txt=" ' Name of text variable
T2ST = "Outside Temp " & fmt(TempUlkoBMES, 1) & "°c\r" ' Scrolling text data
T2ST = T2ST & "Outside RH " & fmt(RHulkoBMES, 0) & "%\r"
T2ST = T2ST & "Outside Pres " & fmt(UlkoPresS, 0) & "\r"
'T2ST = T2ST & "Sea Temp " & fmt(MeriTempS, 1) & "°c\r"
T2ST = T2ST & "Sauna Temp " & fmt(SHT31TempS, 0) & "°c\r"
T2ST = T2ST & "Sauna RH " & fmt(SHT31RHS, 0) & "%\r"
T2ST = T2ST & "Sauna Temp B " & fmt(TempSaunaBMES, 0) & "°c\r"
T2ST = T2ST & "Sauna RH B " & fmt(RHsaunaBMES, 0) & "%\r"
T2ST = T2ST & "Sauna Pres " & fmt(SaunaPresS, 0) & "\r"
Call PutQueueStr(oLCD, TST & chr(34) & T2ST) ' if i divide the text like this it works , most of the time , but still other data to display can be inserted here from other parts of program ... also sometimes the first message does not get sent , only the latter part .
T2ST = "Kive's Temp " & fmt(KiviTempS, 0) & "°c\r"
T2ST = T2ST & "SSR Temp " & fmt(SSRtempS, 0) & "°c\r"
T2ST = T2ST & "Sauna Time " & fmt(SaunaPaallaHS,0) & ":"
If SaunaPaallaMinS < 9.5 then T2ST = T2ST & "0"
T2ST = T2ST & fmt(SaunaPaallaMinS,0) & "\r"
T2ST = T2ST & "Glass Temp " & fmt(LasiTempS, 0) & "°c\r"
T2ST = T2ST & "Kiuas Times " & cstr(SaunaKerratPI) & "x\r"
T2ST = T2ST & "Kiuas Burn " & cstr(SaunaTotalDayI) & "d " & cstr(SaunaTotalHourB) & ":" & cstr(SaunaTotalMinB) & "\r"
Call PutQueueStr(oLCD, T2ST & chr(34) & LcdEndST) ' Send the rest
i tried dividing the text into different strings but that did not work , it seems the PutQuequeStr has a length limit of about 200 characters ?