![]() |
Forum Index : Microcontroller and PC projects : Com Port Problems
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
I think the problem is the SERIAL2 routine. you grab what has arrived but it isn't necessarily sane - it doesn't deal with any potential garbage in the buffer. I would like to get things to a more predictable stage. using INPUT$(254,#2) gets 254 bytes from the serial port - do you want this? do you want/Are you getting 254 bytes? I think this may even cause a delay until 254 bytes are available... I may be wrong (no access to manual) but if there isn't that number of bytes ready, MMBasic will wait until there are - how often does a line of data come in on port 2? EDIT: OK, just read up on this - it will get *up to* 254 bytes, but you are not waiting for the string to arrive fully. The MM is quite quick and serial data can take a "while" to arrive, I think you are not getting a full string and leaving the remainder to arrive after you *think* you've got it... then the next time around, the tail-end of the previous line gets added to the front of the new one. I am fairly convinced this is the root of the problem You could do a quick and dirty pause of 50mS (50 chars) before the INPUT$ in SERIAL2 to try this out. Think about re-writing the serial handler(s) to accept whatever data is there but build it up in another string and then set a flag which you can see in the main thread when you have received a carriage return. That way the string that you built up will only ever contain one whole line and you only have one character showing a newline which makes thing tidier. so you could have something like this (in the main thread so you run through it lots): if (loc(#2)<>0) and (GotCR=0) then c=asc(input$(1,#2)) select case c case >31 ' anything after a space we want. everything else is discarded buf$=buf$+chr$(c) case 13 ' end of a line GotCR=1 end select endif Then at another convenient point (could also be in the main thread) you check the flag and process buf$. Then when you are done, empty the buffer and clear the CR flag buf$="":GotCR=0 to re-arm the serial handler - the handler set the semaphore to 1, effectively disabling itself so it never over-runs buf$. which arms the system for another string to be received. The beauty of this is it almost becomes like a background process - all the string receiving happens without any intervention on your part and it set a "semaphore" (GotCR) when you have something to do. It makes your code event-driven and your buffer contains exactly what you want - even the carriage return is discarded so it contains only the bits you want and no invisible stuff. the routine needs to get one character at a time to ensure that: a. the buffer never runs past the carriage return character b. any nuisance characters are ignored - you can expand the routine to decide what you want the speed of your main loop will have no problems emptying the serial buffer (at 9600baud, each character takes around 1mS to arrive - that's a lot of computing time) so there won't be a noticeable delay in the data. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
|
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
CaptainBoing Changing the ICON$ to ICON$ = left$(FieldArray$(2),3)+".ppm" solved the problem, it now appends the .ppm to the icon name and then displays it properly on the tft display ![]() The problem abut the D$ receiving the data twice still exists, I've triple checked and the data coming INTO The com port from the ESP8266 is definitely ONLY Today,broken clouds,04n this is what print d$ shows [code]Today,broken clouds,04n Today,broken clouds,04n[/code] I can live with it for now as the icon is now displaying properly, however it's really frustrating not knowing why it's doing it |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
If you get ONE copy of the wanted data in the buffer, we know there is no problem there then. The issue has to be somewhere in the code, and I suspect you are NOT clearing your D$ at some point, so you get two messages, cos one is sucked from the COM port buffer and added to D$, then that message is acted on, but there is another identical message still in D$ - so when you print it, you get two. ![]() Whenever you suck data from the COM port buffer, CLEAR D$ with D$="" FIRST, then suck your data from the buffer. That MIGHT be your problem, without reading through the code you uploaded earlier. Smoke makes things work. When the smoke gets out, it stops! |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Your right Data is being held in the buffer and printed twice but I for the life of me cannot figure out how to stop it happening I'd put D$="" in a couple of places but this hasn't resolved the issue I THINK what I need to do is similar to the way COM1 is handled, I'd tried replicating that for COM2 but it just wont work which is why I went with the "simple option" \I just don't know about interupts and how to process them and com port data to figure this out, I might just have to leave it running with the error in there for now |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Add a DEBUG print in your T1 sub: [Code] SUB T1 'T1 Today desc0$ = FieldArray$(1) ICON$ = FieldArray$(2)+".ppm" print icon$ 'DisplayPicture ICON$,280,260 'Weather icon Text 285,310, desc0$ , LM, 2, 1, RGB(BLACK), RGB(WHITE) 'Print the weather description Print "This is what the com port is receiving - " PRINT D$ PRINT "DEBUG: D$ FROM T1 SUB..." '<<<--- DEBUG LINE END SUB Add the line that says: PRINT "DEBUG: D$ FROM T1 SUB..." If you then get a response that is along the lines of: [Code] > RUN 04d Today.ppm This is what the com port is receiving - Today,broken clouds,04d DEBUG: D$ FROM T1 SUB... Today,broken clouds,04d [/Code] This then means that AFTER your T1 sub returns, another copy of the message is being added to D$ then printed again somewhere, or it is just printing D$ again outside of the T1 sub. To confirm the latter, add the following line: D$="" to your T1 sub: [Code] SUB T1 'T1 Today desc0$ = FieldArray$(1) ICON$ = FieldArray$(2)+".ppm" print icon$ 'DisplayPicture ICON$,280,260 'Weather icon Text 285,310, desc0$ , LM, 2, 1, RGB(BLACK), RGB(WHITE) 'Print the weather description Print "This is what the com port is receiving - " PRINT D$ PRINT "DEBUG: D$ FROM T1 SUB..." '<<<--- DEBUG LINE D$="" '<<<---CLEAR D$ END SUB [/Code] If at THIS point, you only get one copy of D$, this proves completely that something outside of the sub is either not clearing D$ when it should, or it is simply re-printing D$ a second time. You could also comment out the PRINT D$ line from your T1 sub, and that should also correct the issue if the above allows you to home in on the problem. Smoke makes things work. When the smoke gets out, it stops! |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
This is the output after trying that [quote]> RUN 01n Today.ppm This is what the com port is receiving - Today,clear sky,01n Today,clear sky,01n DEBUG: D$ FROM T1 SUB... [/quote] I've just told it not to print D$ it's not needed, I only had it there to try and find the original problem with adding .ppm to the end of the icon name now its working fine I#'ll try it tomorrow with the rest of the other 3 days data and not just "Today" but I "think" it will be fine |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
COM1 uses an ISR, builds a string and checks for a CR/LF sequence. COM2 uses polling and checks for data using LOC() as if it were a dynamic file. I think the way you are using LOC() on a serial port could pause problems, hopefully someone with more MMBASIC experience can clarify. You could add a second ISR for serial2 to build D$ or if it is working leave with LOC() leave it. Like Grogster said, you need to clear D$. You might be able to do that in your main DO .. LOOP like you do for SERIAL1, you already have a IF THEN END IF for SERIAL2 to add D$="" to. Screen display looks very nice. |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Azure I did try using a 2nd ISR interupt on COM2 but could't get it to work |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
Did you just try and change in your main DO LOOP from IF LOC(#2) > 0 THEN SERIAL2 'If data in Com1 then GOSUB Serial2 END IF to IF LOC(#2) > 0 THEN SERIAL2 'If data in Com1 then GOSUB Serial2 D$="" END IF That might be all it needs to fix the extra data appearing. I agree with Grogster (as per my first post) to check the string you were trying to add to. You need to verify the strings are as you expect them to be at each stage. A quick print of the string is all you need to make sure it is what you expect (and nothing more in this case). |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
Did some reading up and LOC() works fine on serial port. Changes from current position in random access file (like I was used to) to characters to be read. |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
I'm completely stumped again I now have the data for "today" working properly (albeit ignoring the double data received) However I'm trying to get the forecast working which involved more detail and this isn't working This is the sub to find out which day is needed to be processed and this is workin [code]Sub PenDown Select CASE Touch(REF) CASE GUI_TOMORROW 'is the TOMORROW button pressed? TOMORROW 'call sub TOMORROW CASE GUI_DAY2 'is the DAY2 button pressed? DAY2 'call sub DAY2 CASE GUI_DAY3 'is the DAY3 button pressed? DAY3 'call sub DAY3 CASE ELSE 'the "oops I didn't expect this" case EXIT SUB END SELECT END SUB [/code] This is the code to get the data from the com port (putting D$="" at the end does not work it just clears all the data) [code] IF LOC(#2) > 0 THEN SERIAL2 'If data in Com1 then GOSUB Serial2 END IF[/code] This is the COM2 routine [code]SUB SERIAL2 'Com2 ESP8266 Weather Forecast LOCAL N as INTEGER DO:LOOP UNTIL LOC(#2) 'Wait for some data to arrive in COM2 buffer D$=INPUT$(LOC(#2),#2) 'Suck everything available from the buffer N = GetFieldArray(D$) IF FieldArray$(0) = "Today" THEN T1 'If the 1st array is "Today" then GOSUB T1 IF FieldArray$(0) = "Day2" THEN T2 'If the 1st array is "Day2" then GOSUB T2 'If the 1st array is "Day2" then GOSUB T2 IF FieldArray$(0) = "Day3" THEN T3 'If the 1st array is "Day3" then GOSUB T3 IF FieldArray$(0) = "Day4" THEN T4 'If the 1st array is "Day4" then GOSUB T4 END IF End Sub[/code] SUB T2 (Tomorrow) [code]SUB T2 'T2 Tomorrow ICON1$ = FieldArray$(3) 'ICON desc1$ = FieldArray$(2) 'DESCRIPTION mint1$ = FieldArray$(4) 'MIN-TEMP maxt1$ = FieldArray$(5) 'MAX-TEMP press1$ = FieldArray$(6) 'PRESSURE hum1$ = FieldArray$(7) 'HUMIDITY speed1$ = FieldArray$(8) 'WIND SPEED dir1$ = FieldArray$(9) 'WIND DIRECTION day2$ = FieldArray$(1) 'DAY THE FORECAST RELATES TO 'ICON$ = left$(FieldArray$(2),3)+".ppm" END SUB[/code] Code to display "Tomorrow" - I'm only interested in getting this working at the moment if this works I can figure out the rest of the days [code]Sub TOMORROW print D$ Print "Tomorrow touched" ctrlval(8) = mint1$ ctrlval(9) = maxt1$ ctrlval(20) = press1$ ctrlval(3) = hum1$ ctrlval(12) = speed1$ heading = val(dir1$) 'DisplayPicture ICON1$,280,260 TEXT 330,238, TIME$, LM, 1, 2, RGB(BLACK),RGB(white) Text 285,300, day2$, LM, 2, 1, RGB(BLACK), RGB(WHITE) END SUB[/code] What is actually printed when I touch the Tomorrow button is a random selection of characters in the com port Tomorrow touched Day2,Thu Nov 30 11:00:00 2017 ,light snow,13d,-1.07,2.05,1011.81,86,6,338 Day2,Thu Nov 30 11:00:00 2017 ,light snow,13d,-1.07,2.05,1011.81,86,6 Tomorrow touched 2,4,357 Tomorrow touched 2,4,357 Tomorrow touched Day4,Sat Dec 02 11:00:00 2017 ,light rain,10d,1.63,7.09,1026.75,98,2,292Day4,Sat Dec 02 11:00:00 2017 ,light rain,10d,1.63,7.09,1026.75,98,2,292 Tomorrow touched Tomorrow touched TIME,Wed Nov 29 10:00:59 2017 TIME,Wed Nov 29 10:00:59 2017 Tomorrow touched THIS is what the ESP is actually transmitting to the Micromite [quote] Today,few clouds,02d Day2,Thu Nov 30 11:00:00 2017 ,light snow,13d,-1.07,2.05,1011.81,86,6,338 Day3,Fri Dec 01 11:00:00 2017 ,sky is clear,01d,-0.69,3.53,1023.72,92,4,357 Day4,Sat Dec 02 11:00:00 2017 ,light rain,10d,1.63,7.09,1026.75,98,2,292[/quote] What I find weird is "Today" works - albeit with double data which I said above |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
I would take the faultfinding approach of making sure you can receive the data string from the ESP correctly before trying to work on how to handle (breakup) that string. One logical debugging step at a time. To make things clear do you want to post the current version like you did earlier. I will see if I can come up with a suggestion, or maybe someone else more MM experienced can jump in beforehand. |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
I've now made the program as simple as I can JUST displaying what's coming in on COM2 and nothing else [code] OPTION AUTORUN ON 'Autorun upon power up (after first run) Const buffersize = 511 DIM FieldArray$(50) 'Max number of fields recieved by serial port 2 OPEN "COM2:9600, 1024" AS #2 'Open port for ESP8266 '''**********************Start of Main Program************************************************************************************ Do '***********************Check Serial Ports for Data********************* IF LOC(#2) > 0 THEN SERIAL2 'If data in Com1 then GOSUB Serial2 END IF LOOP End '**************************COM 2 Input************************************************* SUB SERIAL2 'Com2 ESP8266 Weather Forecast LOCAL N as INTEGER DO:LOOP UNTIL LOC(#2) 'Wait for some data to arrive in COM2 buffer D$=INPUT$(LOC(#2),#2) 'Suck everything available from the buffer N = GetFieldArray(D$) IF FieldArray$(0) = "Today" THEN T1 'If the 1st array is "Today" then GOSUB T1 IF FieldArray$(0) = "Day2" THEN T2 'If the 1st array is "Day2" then GOSUB T2 'If the 1st array is "Day2" then GOSUB T2 END IF End Sub '**************************************Today************************************ SUB T1 'T1 Today print D$ "TODAY received data T1" desc0$ = FieldArray$(1) ICON$ = left$(FieldArray$(2),3)+".ppm" Text 285,310, desc0$ , LM, 2, 1, RGB(BLACK), RGB(WHITE) 'Print the weather description END SUB '********************************End of Today************************************************* '*****************************Tomorrow************************************************ SUB T2 'T2 Tomorrow ICON1$ = FieldArray$(3) 'ICON desc1$ = FieldArray$(2) 'DESCRIPTION mint1$ = FieldArray$(4) 'MIN-TEMP maxt1$ = FieldArray$(5) 'MAX-TEMP press1$ = FieldArray$(6) 'PRESSURE hum1$ = FieldArray$(7) 'HUMIDITY speed1$ = FieldArray$(8) 'WIND SPEED dir1$ = FieldArray$(9) 'WIND DIRECTION day2$ = FieldArray$(1) 'DAY THE FORECAST RELATES TO 'ICON$ = left$(FieldArray$(2),3)+".ppm" print D$ "TOMORROW RECEIVED DATA" Text 285,300, day2$, LM, 2, 1, RGB(BLACK), RGB(WHITE) END SUB '***************************************END OF Tomorrow*************************************** '***************************Function to get array from COM port******************************* Function GetFieldArray( Record$, Delimiter$, KeepQuotes ) Local Index, Char, InQuote, Count InQuote = 0 Count = 0 FieldArray$(Count) = "" If Delimiter$ = "" Then Delimiter$ = "," For Index = 1 To Len(Record$) Char = Asc(Mid$(Record$, Index, 1)) If Char = 34 Then InQuote = Not InQuote If Not InQuote And Instr(Delimiter$, Chr$(char)) >= 1 Then Count = Count + 1 FieldArray$(Count) = "" Else If Char <> 34 Or KeepQuotes Then FieldArray$(Count) = FieldArray$(Count) + Chr$(char) EndIf EndIf Next GetFieldArray = Count + 1 End Function '***********End of this function******************** [/code] Nothing is being printed!!! even though data is coming in on COM2 This is what the ESP is transmitting and the Micromite COM2 is receiving [quote]Today,few clouds,02d Day2,Thu Nov 30 11:00:00 2017 ,light snow,13d,-1.07,2.05,1011.81,86,6,338 Day3,Fri Dec 01 11:00:00 2017 ,sky is clear,01d,-0.69,3.53,1023.72,92,4,357 Day4,Sat Dec 02 11:00:00 2017 ,light rain,10d,1.63,7.09,1026.75,98,2,292[/quote] |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
Changing the ICON$ to ICON$ = left$(FieldArray$(2),3)+".ppm" solved the problem Hi Lew. My "fix" above simply threw away the rubbish that was muddying the waters - we need to stop the water getting muddy in the first place ![]() This is only a "kludge " and you should really work towards getting a tidy string to work with. I still think it is down to SERIAL2; grabbing the contents of a buffer and hoping for the best isn't a reliable method. but it is very hard to debug using a forum |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
haven't looked at the code much but noticed this straight away SUB SERIAL2 'Com2 ESP8266 Weather Forecast LOCAL N as INTEGER DO:LOOP UNTIL LOC(#2) 'Wait for some data to arrive in COM2 buffer D$=INPUT$(LOC(#2),#2) 'Suck everything available from the buffer N = GetFieldArray(D$) IF FieldArray$(0) = "Today" THEN T1 'If the 1st array is "Today" then GOSUB T1 IF FieldArray$(0) = "Day2" THEN T2 'If the 1st array is "Day2" then GOSUB T2 'If the 1st array is "Day2" then GOSUB T2 END IF <---- take this out End Sub you only need EndIf when the If is spread across multiple lines... so: IF this THEN that ENDIF or IF this THEN that but not IF this THEN that ENDIF |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
I've now gone back to the barest of basics And hopefully Peter will be pleased - I'm using OPTION EXPLICIT and OPTION DEFAULT NONE I've also altered the data being sent by the ESP8266 so the last character in EACH transmission is the character * This should "hopefully" make the com port easier to work with once I figure out how to tell the com port that once it receives the * to process the data [code] OPTION AUTORUN ON 'Autorun upon power up (after first run) option explicit option default none DIM FieldArray$(50) 'Max number of fields recieved by serial port 2 DIM D$ OPEN "COM2:9600, 1024" AS #2 'Open port for ESP8266 '''**********************Start of Main Program************************************************************************************ Do '***********************Check Serial Ports for Data********************* If LOC(#2)<>0 then D$=INPUT$(LOC(#2),#2) 'Suck everything out of buffer so it is empty for next time SERIAL2 endif LOOP End '**************************COM 2 Input************************************************* SUB SERIAL2 'Com2 ESP8266 Weather Forecast IF FieldArray$(0) = "Today" THEN T1 'If the 1st array is "Today" then GOSUB T1 IF FieldArray$(0) = "Day2" THEN T2 'If the 1st array is "Day2" then GOSUB T2 'If the 1st array is "Day2" then GOSUB T2 print D$ "HERE IT IS" '*******This prints EVERY character received on the com port separately and then ONLY PRINTS "HERE IT IS" and then a new line before it prints again****** End Sub '**************************************Today************************************ SUB T1 'T1 Today desc0$ = FieldArray$(1) PRINT DESC0$ ICON$ = left$(FieldArray$(2),3)+".ppm" print ICON$ 'Text 285,310, desc0$ , LM, 2, 1, RGB(BLACK), RGB(WHITE) 'Print the weather description END SUB '********************************End of Today************************************************* '*****************************Tomorrow************************************************ SUB T2 'T2 Tomorrow ICON1$ = FieldArray$(3) 'ICON desc1$ = FieldArray$(2) 'DESCRIPTION mint1$ = FieldArray$(4) 'MIN-TEMP maxt1$ = FieldArray$(5) 'MAX-TEMP press1$ = FieldArray$(6) 'PRESSURE hum1$ = FieldArray$(7) 'HUMIDITY speed1$ = FieldArray$(8) 'WIND SPEED dir1$ = FieldArray$(9) 'WIND DIRECTION day2$ = FieldArray$(1) 'DAY THE FORECAST RELATES TO 'ICON$ = left$(FieldArray$(2),3)+".ppm" print D$ "TOMORROW RECEIVED DATA" Text 285,300, day2$, LM, 2, 1, RGB(BLACK), RGB(WHITE) END SUB '***************************************END OF Tomorrow*************************************** '***************************Function to get array from COM port******************************* Function GetFieldArray( Record$, Delimiter$, KeepQuotes ) Local Index, Char, InQuote, Count InQuote = 0 Count = 0 FieldArray$(Count) = "" If Delimiter$ = "" Then Delimiter$ = "," For Index = 1 To Len(Record$) Char = Asc(Mid$(Record$, Index, 1)) If Char = 34 Then InQuote = Not InQuote If Not InQuote And Instr(Delimiter$, Chr$(char)) >= 1 Then Count = Count + 1 FieldArray$(Count) = "" Else If Char <> 34 Or KeepQuotes Then FieldArray$(Count) = FieldArray$(Count) + Chr$(char) EndIf EndIf Next GetFieldArray = Count + 1 End Function '***********End of this function********************[/code] This is now what's being received by the Micromite [quote]Today,broken clouds,04d,* Day2,Thu Nov 30 11:00:00 2017 ,light snow,13d,-1.07,2.05,1011.81,86,6,338,* Day3,Fri Dec 01 11:00:00 2017 ,sky is clear,01d,-0.69,3.53,1023.72,92,4,357,* Day4,Sat Dec 02 11:00:00 2017 ,light rain,10d,1.63,7.09,1026.75,98,2,292,*[/quote] Serial 2 sub isn't working properly, I've commented what the fault is in the sub |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
*Edit: Your post above came in while I was writing this. * SERIAL2 calls a ArrayVariable() that has not been processed yet. * Still think getting interrupts to work is the better way to go. * Code below is paring it right back, build it up when that works. I hope this can help. Using ISE is a much better way to go same as COM1. If it works for you then you can add the line decoding into a string array. If there are more unwanted characters in the input stream then they can be filtered out with more case statements. It stops reading characters while complete line is processed. Might need more work if line is not handled in time as input buffer will get ahead. OPTION AUTORUN ON 'Autorun upon power up (after first run) option explicit Dim Esp$ = "" 'Serial 2 ESP8266 input string Dim EspCmd% = 0 'Serial 2 ESP8266 line received flag Dim Count% = 0 'Counter to put stuff on screen Open "COM2:9600, 1024", EspIsr As #2 'Open port for ESP8266 ' *** Start of Main Program *** Do ' *** Check Serial Ports for Data *** If EspCmd% = 1 Then 'Complete ESP line received Print 'Start new line after printing waiting **** Count% = 0 'Reset count to start waiting message again Print Esp$ 'Print line to check it 'Add processing for line received here Esp$ = "" 'Clear line ready for next one to come in EspCmd% = 0 'Clear line received flag so we can get next line Else 'Just print something to show we are running If Count% = 0 Then Print "Waiting: " ; Count% = 1 Print "*" ; 'Print * to keep it short on same line Pause 250 'Might cause issues with serial port buffering End If Loop ' *** COM 2 Input *** Sub EspIsr ' serial port 2 ESP8266 interrupt handler Local T$ length 10 If EspCmd = 0 Then 'Dont get more if previous line not handled T$ = Input$(1,#2) 'Get data into temp buffer Print "ESP char: " T$ " Received" 'Just to check for other unwanted chars Select Case T$ Case Chr$(13) EspCmd% = 1 'Set flag to say we have finished this line Else Esp$ = Esp$ + T$ 'Add new char to ESP input string End Select End If End Sub End Hope it works and fits your coding style, can help more with it if you want. If not just ignore. |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Thanks Azure, I like it It only prints "waiting for complete line...." and never gets the input but it's a good start ![]() IS there a way to mod that code so it checks for the character "*" and takes that as the end of data command and then processes the data? IE * is the last character sent by the ESP with each line it transmits |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
I will update it and post, just need to change case condition. My copy/paste has died, will restart and post change. |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |