![]() |
Forum Index : Microcontroller and PC projects : RC6 PRINT Problem?
Author | Message | ||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 442 |
The following (it worked in RC5): PRINT "FAULTY SPEEDOMETER SPOTTER!!" PRINT "SECONDS",@(120);"MILES PER HOUR" PRINT "*******",@(120);"***** *** ****" should print FAULTY SPEEDOMETER SPOTTER!! SECONDS MILES PER HOUR ******* ***** *** **** Instead it prints FAULTY SPEEDOMETER SPOTTER!! MILES PER HOUR SECONDS Edited 2020-12-14 02:22 by toml_12953 |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
Works for me as expected - try downloading and flashing again |
||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 442 |
Have you tried over the serial connection instead of to the screen? That's what I was running at the time. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
I always run over the serial connection so I tend to miss screen issues rather than the other way round |
||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 442 |
What terminal emulator are you using? I tried TeraTerm and PuTTY on Windows. Is it possible they don't respond to control codes properly? I'll try to re-download anywway. If it works, then the verification function on the programmer doesn't work too good! |
||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 442 |
But if I run again without clearing the screen, it runs normally and prints FAULTY SPEEDOMETER SPOTTER SECONDS MILES PER HOUR ******* ***** *** **** I can run over and over without clearing the screen and the output is OK. The first run after a CLS always has the SECONDS missing. Edited 2020-12-14 06:18 by toml_12953 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
I'll try to re-download anywway. If it works, then the verification function on the programmer doesn't work too good! Peter wants you to download the ZIP file again, not just re-flash. There was a problem with the first one he uploaded. I can't see any problems with the latest firmware. Jim VK7JH MMedit |
||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 442 |
I'll try to re-download anywway. If it works, then the verification function on the programmer doesn't work too good! Peter wants you to download the ZIP file again, not just re-flash. There was a problem with the first one he uploaded. I can't see any problems with the latest firmware. Jim Yes, That's what I mean by re-download. I call sending the file to the computer flashing. I have redownloaded the ZIP and re-flashed the firmware. Both TeraTerm and PuTTY have a problem when I first do a CLS. When they reach the bottom of the screen they don't show all the output either. Here's the whole program I was using: 10 PRINT "FAULTY SPEEDOMETER SPOTTER" 20 PRINT 30 PRINT "SECONDS",@(120);"MILES PER HOUR" 40 PRINT "*******",@(120);"***** *** ****" 50 PRINT 60 FOR T=70 TO 40 STEP -1 70 LET F=T/3600 80 LET R=1/F 90 PRINT T,@(120);R 100 NEXT T 110 END When I first run it the word SECONDS is missing. After that, SECONDS shows up but some output is missing if the whole table would extend past the bottom of the terminal window. P.S. Please look past the program itself. It's just an example to show corrupted output in terminal programs. Edited 2020-12-14 07:15 by toml_12953 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
When you use PRINT @(x), MMBasic translates the position into VT Escape codes such as <esc>[23;15f The pixel position converts to character positions. Normally, you would include the 'y' position as well. MMBasic uses the current line and the y value if not provided. In the example code you provided, the first few lines print without any location information and the first time you use location is before the "MILES" IT is this mix of position printing and plain printing that confuses the terminal programs. If you want your program to display correctly on terminals, it is safer to use full positioning (x,y) and for the whole display page, not just part of it. It is also safer to start you program with a CLS. MMBasic is sending the same information, but with CLS, the line number will be different compared with not doing a cls. Jim VK7JH MMedit |
||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 442 |
The pixel position converts to character positions. Normally, you would include the 'y' position as well. MMBasic uses the current line and the y value if not provided. In the example code you provided, the first few lines print without any location information and the first time you use location is before the "MILES" IT is this mix of position printing and plain printing that confuses the terminal programs. If you want your program to display correctly on terminals, it is safer to use full positioning (x,y) and for the whole display page, not just part of it. It is also safer to start you program with a CLS. MMBasic is sending the same information, but with CLS, the line number will be different compared with not doing a cls. Jim Thanks for your clear explanation! I don't use the serial interface very often but wanted to report a bug if it was one. Now I see it's not. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |