Posted: 05:50pm 28 Nov 2024 Copy link to clipboard
stanleyella Guru
If vga<>0 Then Print "x" else Print "y" end if
actually if condition is not met it skips to next line,good x=2 if x=2 then inc x+1 if x=4 then inc x-1 if x=3 then inc x-1 end if Edited 2024-11-29 04:11 by stanleyella
Posted: 06:02pm 28 Nov 2024 Copy link to clipboard
matherp Guru
and you found that syntax in the manual where?
Posted: 06:13pm 28 Nov 2024 Copy link to clipboard
Also, when requesting information about the status of an SD card that is not configured with OPTIONS, an error occurs, although I would expect to receive some information about the status.
> ? MM.Info(SDCARD) Error : SDcard not configured
Edited 2024-11-29 04:18 by javavi
Posted: 06:18pm 28 Nov 2024 Copy link to clipboard
matherp Guru
Only if you try to execute a function as a command
What is the point you are making in the first part of the post? pinno take a pin number and returns a GP number giving it a gp number makes no sense hence the error
Posted: 06:21pm 28 Nov 2024 Copy link to clipboard
javavi Guru
Posted: 06:28pm 28 Nov 2024 Copy link to clipboard
matherp Guru
Will look Edited 2024-11-29 04:30 by matherp
Posted: 06:31pm 28 Nov 2024 Copy link to clipboard
JohnS Guru
x=2 if x=2 then inc x+1 if x=4 then inc x-1 if x=3 then inc x-1 end if
Wrong syntax - each inc is missing a comma
John
Posted: 06:31pm 28 Nov 2024 Copy link to clipboard
I guess you were hoping for the same output as from > ? MM.Info(pin GP12)
or else 16
John Edited 2024-11-29 04:35 by JohnS
Posted: 06:36pm 28 Nov 2024 Copy link to clipboard
Mixtel90 Guru
Javavi: ? MM.INFO(PIN 16) gives pin status ? MM.INFO(PINNO GP0) gives the physical pin number (for a standard Pico board) of GP0 (in this case, 1)
You'll get an error if you use MM.INFO(PINNO GP12) on a HDMI system because GP12 doesn't exist, it's HSTX0 (which you can't use in this command).
Posted: 06:46pm 28 Nov 2024 Copy link to clipboard
javavi Guru
You'll get an error if you use MM.INFO(PINNO GP12) on a HDMI system because GP12 doesn't exist, it's HSTX0 (which you can't use in this command).
It seems to me somehow wrong to give an error here, let it still return information about the Pico pin number for the requested GPn. Edited 2024-11-29 04:56 by javavi
Posted: 06:57pm 28 Nov 2024 Copy link to clipboard
dddns Guru
RP2040V6.00.01.RC3:
I use "option lcdpanel console 2" on a ssd1963 display. As long as valid commands are entered the font stays at #2. If a syntax error is done, the font switches to #1 and stays as long as the editor is used or "option lcdpanel console 2" is run again.
Posted: 06:58pm 28 Nov 2024 Copy link to clipboard
Mixtel90 Guru
There is no GP12. It's probably been disconnected from the GPIO matrix. It's really no problem if you know which sort of display you are using, otherwise you could probably trap it with ON ERROR. I wouldn't call it a deal breaker, you'd know not to use the VGA pins as digital IO anyway, wouldn't you?
Posted: 07:03pm 28 Nov 2024 Copy link to clipboard
matherp Guru
?I use "option lcdpanel console 2" on a ssd1963 display. As long as valid commands are entered the font stays at #2. If a syntax error is done, the font switches to #1 and stays as long as the editor is used or "option lcdpanel console 2" is run again.
This is deliberate. The error function has to know that it has a valid font to use so switches to font 1 that can't be overridden. You can switch back just using the font command (font 2)
Posted: 07:05pm 28 Nov 2024 Copy link to clipboard
javavi Guru
otherwise you could probably trap it with ON ERROR. I wouldn't call it a deal breaker, you'd know not to use the VGA pins as digital IO anyway, wouldn't you?
Yes, it is probably possible. But I don't like that where I expect to receive information I get an error, which I have to accept as information and somehow process. For example:
> ? MM.Info(SDCARD) Error : SDcard not configured
although the manual says
Returns the status of the SD Card. Valid returns are: DISABLED, NOT PRESENT, READY, and UNUSED
Edited 2024-11-29 05:11 by javavi
Posted: 07:09pm 28 Nov 2024 Copy link to clipboard
Mixtel90 Guru
You can't get the status of something that has no wires to it or that has wires but you don't know which pins they are on. :)
Posted: 07:10pm 28 Nov 2024 Copy link to clipboard
matherp Guru
I'll fix both but then you need to make sure you don't try and use the pin because that will definitely cause an error
Posted: 07:17pm 28 Nov 2024 Copy link to clipboard
dddns Guru
This is deliberate. The error function has to know that it has a valid font to use so switches to font 1 that can't be overridden.
I'm using as well the option "default font 2,1". I've seen this behavior for the first time.
Footnote added 2024-11-29 05:25 by dddns Just checked with v6.00.00RC4 and it stays at font #2 after a command with a syntax error is entered. This is what I'm used to since 5.08
Posted: 07:17pm 28 Nov 2024 Copy link to clipboard
javavi Guru
I'll fix both but then you need to make sure you don't try and use the pin because that will definitely cause an error
I think that other commands for accessing this pin used will in turn return an error, or the program will have to check the access status to the port with which it will work. For example: