-->
Page 1 of 1

SERIALPRINTLN or SERIALPRINT example of variables

PostPosted: Tue Jan 26, 2016 4:18 pm
by Davidpurola
I would like to see a few examples of SERIALPRINTLN and SERIALPRINT used with variables mixed with text. I have yet to get this command to work with anything other than time().

David Purola,

Re: SERIALPRINTLN or SERIALPRINT example of variables

PostPosted: Thu Jan 28, 2016 5:53 pm
by Davidpurola
This is the simple code that does NOT work. I have written in basic for 40+ years and I don't understand...

memclear
counter = 0
timesetup(-5,0)
delay 1000
timer 1000 [incsec]
wait
'
[incsec]
counter = counter + 1
if counter = 60 then gosub [gettime]
wait
'
[gettime]
counter = 0
bla = time()
hh = mid(bla,12,2) 'hour
mm = mid(bla,15,2) 'min
ss = mid(bla,18,2) 'sec
serialprintln "hour=",hh,"minute=",mm,"seconds=",ss
return

[Exit]
end

Re: SERIALPRINTLN or SERIALPRINT example of variables

PostPosted: Thu Jan 28, 2016 6:23 pm
by Mmiscool
In this really basic implementation of basic you would have to do each variable or string individually.

Code: Select allserialprint "hour="
serialprint hh
serialprint "minute="
serialprint mm
serialprint "seconds="
serialprintln ss


The output would all be on one line in this case.