Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:08 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : LINE command when using STM32L4

Author Message
sawasdee01
Newbie

Joined: 23/12/2016
Location: United Kingdom
Posts: 33
Posted: 07:19am 15 Mar 2019
Copy link to clipboard 
Print this post

I was wondering whether Peter or indeed anyone with a STM32L433 board with a TFT panel might have a few seconds to load up the mini program below using MMEdit.

There appears to be a problem with the LINE command, in that it always looses the minus sign from the first argument, when the program is loaded using MMEdit.

It is possible that I am using the wrong version of MMEdit for the STM32L4, but the issue is so consistent, that I think that the issue may be with LINE itself, or the way that LINE is parsed.

I am using MMEdit version 4.7 and the STM32L4 firmware 5.0506 (according to PRINT MM.VER)

Best wishes to all.

Sawasdee.



' LINE Issue Demo Prog
' Running on STM32L433 using 5.0506 Armite (version by using PRINT MM.VER)

Const PH0 = 5 'TFT Backlight Pin

' *************************** Main ****************************

SetPin PH0,DOUT ' Configure Hardware IO

Pin(PH0)=1 ' Turn on the backlight

DO_GRFX() ' Draw cross-hair in middle of screen

DO WHILE (INKEY$ = "") ' Bail out on keyboard activity
loop

END

' ************************* Subroutines ****************************

SUB DO_GRFX()
LOCAL x%,y%
x%=120
y%=120
LINE x%–10,y%-10,x%+10,y%+10
LINE x%–10,y%+10,x%+10,y%-10
END SUB
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 12:46pm 16 Mar 2019
Copy link to clipboard 
Print this post

Your listing has a strange character as the first minus sign. If you look closely at your post you will see the first minus in both lines is longer than the later one in the lines.

If you delete the first minus and replace it with a "proper" one it loads perfectly.

Very bizarre
 
sawasdee01
Newbie

Joined: 23/12/2016
Location: United Kingdom
Posts: 33
Posted: 01:04pm 16 Mar 2019
Copy link to clipboard 
Print this post

Hi Peter,

I am so sorry to have bothered you with this and a huge 'thank you' for your help.

I suspect that the problem is being caused by the fact that I am using a Thai/English keyboard, which allows dynamic switching between languages - ้กเเหอก้เ้ก - a bit like that.

Anyhow, I fiddled around with re-typing, manually cutting and pasting minus signs, etc and it now works perfectly.

Cheers

Sawasdee

 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:11am 17 Mar 2019
Copy link to clipboard 
Print this post

The culprit is the "EN Dash" that is mostly used to show ranges in numbers and dates.
In MS Word: Ctrl + Minus Key (with Num Lock enabled)

The sort of thing that gets into our code when copy and paste from Word documents and PDFs. Just like the 'smart quotes' etc.

MMEdit has an option for replacing smart quotes and I will add the EN dash to the list of characters checked for.


Jim

VK7JH
MMedit
 
sawasdee01
Newbie

Joined: 23/12/2016
Location: United Kingdom
Posts: 33
Posted: 12:26am 18 Mar 2019
Copy link to clipboard 
Print this post

Very welcome help that will stop people like me from doing daft things.

Best wishes.

Sawasdee
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025