Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:30 04 May 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 : PicoMite V6.00.02 release candidates - all versions

     Page 29 of 36    
Author Message
circuit
Senior Member

Joined: 10/01/2016
Location: United Kingdom
Posts: 268
Posted: 06:02pm 17 Apr 2025
Copy link to clipboard 
Print this post

  matherp said  I can easily add a "HELP arg$" command. This would look on the A: drive for a file "help.txt" search down the file for a line starting with "~"+arg$ and output everything from the end of arg$ until the next "~" to the console. However, I am not volunteering to create help.txt. I would propose a syntax of each command something like

  Quote  ~command:command param,[optional param]:multi-line if required text description


Let us not forget the very excellent full syntax help system that is available in the help menu of MMEdit. It is a substantial reference, always to hand.
 
bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 68
Posted: 07:40pm 17 Apr 2025
Copy link to clipboard 
Print this post

  matherp said  I can easily add a "HELP arg$" command. This would look on the A: drive for a file "help.txt" search down the file for a line starting with "~"+arg$ and output everything from the end of arg$ until the next "~" to the console. However, I am not volunteering to create help.txt. I would propose a syntax of each command something like

  Quote  ~command:command param,[optional param]:multi-line if required text description


Nice idea!
What about giving the possibility to specify the helpfile_path$ ?
E.g. by OPTION HELPFILE ?

Cos the drive A: could be too small for a larger helpfile - and B: (SDCARD) would offer "nearly unlimited" storage..
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7475
Posted: 09:19pm 17 Apr 2025
Copy link to clipboard 
Print this post

Compress the file & put it on A:. :)  There's no guarantee that there will be a B: present, especially on minimal systems. Text will compress remarkably well without major effort, especially when the vocabulary is fairly limited. Even if you simply use 2 bytes for words over 3 characters long you can shrink text a lot. Only the bit after the colon needs to be compressed so the file is still searchable as a normal text file using the ~ and :.

Mind you, it's a bit more work. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10013
Posted: 09:27pm 17 Apr 2025
Copy link to clipboard 
Print this post

  Quote  What about giving the possibility to specify the helpfile_path$ ?


I made an offer. Accept it or don't, but don't change it.
 
k2backhoe
Regular Member

Joined: 04/12/2021
Location: United States
Posts: 47
Posted: 03:24am 18 Apr 2025
Copy link to clipboard 
Print this post

ERROR? setting the araw configuration on the RP2350B grounds the analog input pin
It appears that using the setpin gpxx,araw command on the RP2350B version sets the input pin to output a digital zero
I am trying to read the ADC channels on a RP2350B (Weact Studio RP2350B Core Board from AliExpress)
I have a 10k pot set up as a voltage divider from 3.3V to GND, wiper is connected to the ADC pin indicated

Using a conventional (original) Pi Pico with RP2040 and V6.00.02RC15
> setpin gp26,ain
> ?pin(gp26)
1.595604396
Voltmeter on gp26 reads 1.599v

> setpin gp26,araw
> ?pin(gp26)
1982
Voltmeter on gp26 reads 1.598v.      3.3 / 1.598 * 1982 =  4101 (~4095, as expected)
So far, so good.  All works as expected.

Using a Weact Studio RP2350B Core Board
Voltmeter on gp26 reads 1.552v      Still as expected
> setpin gp41,ain
> ? pin(gp41)
1.534358974
Voltmeter on gp26 reads 1.552v      Still as expected

> setpin gp41,araw        %%%%%% As soon as this command executed, gp41 drops to 0.078 volts using external voltmeter
> ? pin(gp41)
95                            %%%%%%%% Should be ~ 2000
Voltmeter on gp26 reads 0.078v      %%%%% should be ~ 1.55 V

> setpin gp41,ain
Voltmeter on gp26 goes back up to 1.556v
N.B.  the arithmetic is correct,  3.3 / 0.078 * 95 = 4019  (~4095, as expected)

It looks like the software routine for the command [setpin gp41,araw] causes the pin GP41 to output a logical 0
PS: On page 136 of the manual Ver 6.00.01
"ARAW Fast analog input returning a value between 0 and 1023."
should be "ARAW Fast analog input returning a value between 0 and 4095."
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 288
Posted: 05:19am 18 Apr 2025
Copy link to clipboard 
Print this post

I aiming this to comunity, as Peter made offer. Discusion could be moved to another thread too, as there is no any rush with current release:

What I like about Peter`s offer is:
-one small help.TXT file which extends LIST COMMANDS, LIST FUNCTIONS.

- It could be fast drop - in solution suitable to check syntax and command optionals WITH OPTIONAL multiline notes for USER to fill in himself. Not for absolute newbies, while still helpful. Flash firmware, drop file via terminal and you have some better helper.

- As it would be proper command integrated in firmware, prompt enters is stored in lastcmd buffer. Sometimes it is handy.

How this can be ruined ?  

- Help needs to be easy updatable, or corrected if there is no 'official' update but user found error. Or if user wants to add some note , then he EDITs file, makes additions. Means help.txt should be simple TXT file

- big, fat, one file with everything.
TXT databases were created for reason ant flash is not that fast.

I would volunteer if comunity needs just:
~command:command param,[optional param]

With multiline left empty for user to fill, if he needs it
:multi-line if required


I am not the most accurate person and not native english speaker. Maybe another person would be better to volunteer instead

P.S. I already created help system which could be stored in B: and could grow as large as user would want. I created it with idea to be helpful if user does not know exactly what he is searching or dont know EXACT keywoard. I created it to be usefull for newbie like myeself and handy for experenced user if he does not need full info.
I created it for somebody who wants less dependence of main PC

I will make improvements and updates on it time to time, to make it better.  As it really is only V0.1 experimental stage.
Edited 2025-04-18 15:21 by electricat
My MMBasic 'sand box'
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10013
Posted: 07:51am 18 Apr 2025
Copy link to clipboard 
Print this post

  Quote  ERROR? setting the araw configuration on the RP2350B grounds the analog input pin


Thanks for the report - found and fixed

NB: I will be removing OPTION FAST TRIG from the next release. The fault in GUI GAUGE also manifests itself in trig functions using single precision. All other trig in MMBasic is double precision so there are no other commands affected by what appears to be a bug in the Pico sdk for the RP2350

UPDATE: posted on the Pico forum and this is an issue that is apparently been seen by someone else so will definitely sticking to double precision
Edited 2025-04-18 19:55 by matherp
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7475
Posted: 09:57am 18 Apr 2025
Copy link to clipboard 
Print this post

Just an idea...

If one was *really clever* there could be 2 help files.

File1 - lives on A: and has no comments, just a record number where they would be This keeps the size down. One line per command or function with the minimal info.

File2 - lives on B: and contains just the comments. This is searched by record number. This allows the use of, for example, record 1 which is just "No comments stored", which would be the initial setup.

Both files would be ordinary text files, so easily edited. The user could simply add lines to File2 and put that line (record) number into File1 as the comment.

Is this over-complicated?

.
Edited 2025-04-18 19:58 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3989
Posted: 10:26am 18 Apr 2025
Copy link to clipboard 
Print this post

  Mixtel90 said  Is this over-complicated?
.

Probably.  Especially when there's no B:

John
 
bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 68
Posted: 10:55am 18 Apr 2025
Copy link to clipboard 
Print this post

  matherp said  
  Quote  What about giving the possibility to specify the helpfile_path$ ?


I made an offer. Accept it or don't, but don't change it.


Yes, of course I do accept. It's your work and effort.. I really appreciate what you're doing!
Just was an idea.. You inspired me..

An other idea: The 1st line in the "help.txt" could be a "link" (path) to a bigger helpfile e.g. on "B:" - perhaps easier to implement and less work?

But as I just said: I don't want to cause you unnecessary work or "put down" your ideas/offers. Especially since revision 6.0.2 is "one minute to 12 o'clock", so you want to do a release and your focus is on bug fixes?

bfwolf
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7475
Posted: 11:51am 18 Apr 2025
Copy link to clipboard 
Print this post

@JohnS
But at least it's usable without B:. A single large file with comments may not fit on A:, in which case you have nothing. Compression is the other way but that's even more complicated.

Peter's offer looks good to me. It's unlikely that anyone is going to need a full help file. Even I've got past needing help entries for a lot of the commands. :)  I see this more of a case of having an on-line mid-range reminder, after all we have LIST COMMANDS and LIST FUNCTIONS to see a lot of what's available and the manual for anything more in-depth.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10013
Posted: 11:57am 18 Apr 2025
Copy link to clipboard 
Print this post

I've change the filespec slightly. Filename is "help.txt" - lowercase. Everything should be on different lines. Below is my test file and the result.





  Quote  ~COLOR
COLOR fore [, back]
Sets the default color for commands (PRINT, etc)
that display on the on the attached LCD panel.
'fore' is the foreground colour, 'back' is the background colour.
The background is optional and if not specified will default to black.
~COLOUR
COLOUR fore [, back]
Sets the default colour for commands (PRINT, etc)
that display on the on the attached LCD panel.
'fore' is the foreground colour, 'back' is the background colour.
The background is optional and if not specified will default to black.
~COLOUR MAP
COLOUR MAP inarray%(),outarray%() [,colourmap%()]
This command generates RGB888 colours in outarray% from colour codes (0-15)
in inarray%. If the optional colourmap% parameter is used this must be 16
elements long). In this case the values in inarray% are mapped to the colours
for that index value in colourmap%
~DO
DO <statements> LOOP
Loops while Loops while 'expression' is true (this is equivalent to the older
WHILE-WEND loop).If, at the start, the expression is false the statements in the
loop will not be executed, not even once.
~DO WHILE
DO WHILE expression <statements> LOOP
Loops until the expression following UNTIL is true. Because the test is made
at the end of the loop the statements inside the loop will be executed at least
be executed, not even once.
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 455
Posted: 12:22pm 18 Apr 2025
Copy link to clipboard 
Print this post

thx Peter!
When can we expect the final release?
Matthias
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10013
Posted: 03:23pm 18 Apr 2025
Copy link to clipboard 
Print this post

V6.00.02RC16 is available on

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Fixes bug in GUI GAUGE
Fixes bug in SETPIN n,ARAW
Removes OPTION FAST TRIG ON/OFF as there is a bug in the Pico implementation of the C functions cosf and sinf so this is not reliable

Implements HELP [search_pattern$] command. See above.

HELP without a parameter just outputs the text:
"Enter help and the name of the command or function
Use * for multicharacter wildcard or ? for single character wildcard"

This looks for a file on the A: drive named "help.txt"
This must be formatted as follows:
~searchable_string
text line - recommend this is the command syntax e.g. COLOUR fore [, back]
text line
....
text line
~next_searchable_string
text line
....
etc.

There can be one or many text lines for each searchable_string. It is highly recommended that text lines do not exceed 80 characters in length

in the "search_pattern" use * for multicharacter wildcard or ? for single character wildcard

The command will output all sections (between the matching searchable string and the next searchable string) where the search_pattern matches the searchable_string
Edited 2025-04-19 01:23 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4824
Posted: 03:54pm 18 Apr 2025
Copy link to clipboard 
Print this post

Peter,

What scroll mechanism is in help? When there is more text than 1 screen? Same as with LIST?

Volhout
Edited 2025-04-19 01:55 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10013
Posted: 03:57pm 18 Apr 2025
Copy link to clipboard 
Print this post

None. The assumption is that a typical search will return less than a page of output. If anyone is creating help that returns more than that they will probably use all the A: drive first
Edited 2025-04-19 01:59 by matherp
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3300
Posted: 05:09pm 18 Apr 2025
Copy link to clipboard 
Print this post

All three of the 64-pin PCBs I had had trouble with worked with V6.00.02RC16.

Surprising to me, the one on which I had soldered the PSRAM which when OPTION PSRAM PIN GP0 was entered, went into forever presenting the "D:" drive instead of a serial port, now shows the PSRAM available after that option was provided. I had thought it would perhaps not find it but not care.

Thanks always, Peter, for your outstanding work.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 288
Posted: 05:42pm 18 Apr 2025
Copy link to clipboard 
Print this post

  matherp said  
Implements HELP [search_pattern$] command. See above.
This looks for a file on the A: drive named "help.txt"
This must be formatted as follows:


Draft help.txt 'build' here
help.txt.zip



Edited 2025-04-19 03:47 by electricat
My MMBasic 'sand box'
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 288
Posted: 07:07am 19 Apr 2025
Copy link to clipboard 
Print this post

Some errors corrected
Added better PEEK, POKE, FORMAT$ explanationes etc
(Changes may be seen with any text comparing tool)

Anyone wishes test it, can download help.txt here
help.txt.zip

I think it has now all universal notes for public use. And All other help notes would be by personal 'taste' to add .

Your opinions, comunity?

Using/sharing this help.txt file BETA key might be added ultra easy, so by entering
>HELP "*BETA*" you might list then all current BETA addons!!! (did not included in this upload yet) All latest @Pater`s commands and functions added, needs to be collected. Maybe somebody collected in one place?
@Mick ?

(This I used this BETA for myeself in my own help system but with braoder explanations. )
My MMBasic 'sand box'
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10013
Posted: 07:23am 19 Apr 2025
Copy link to clipboard 
Print this post

  Quote  What scroll mechanism is in help? When there is more text than 1 screen? Same as with LIST?


I originally didn't do this because the list mechanism is very basic and splits lines in the middle of words and fails when the last line to be displayed is too long. In which case, the "press any key" happens after the first line has already scrolled off, or, even worse, on a display with no scroll, after the whole screen has been wiped.

To fix this I needed a mechanism to split the line only on word boundaries. Not too hard but the sort of thing that would take several iterations to get right.

Lets see what AI can do (Cortana).

My instruction
  Quote  write a routine in C that takes a  c string containing a line of text and a screen width in characters. Output the string using printf or similar but if the string length exceeds the screen width split the output onto 2  or more lines. However, the break should only appear on a space character which if it is replaced by crlf should be discarded.


followed by
  Quote  ensure you cater for the limit condition where the string has no spaces. In this case truncate the output at the screen width.


The AI wrote
#include <stdio.h>
#include <string.h>

void printWrappedText(const char *text, int screenWidth) {
   int length = strlen(text);
   int start = 0; // Start index of the current line

   while (start < length) {
       int end = start + screenWidth; // Calculate the end index for the current line
       if (end >= length) {
           // If end is beyond the text length, just print the remaining text
           printf("%s\n", text + start);
           break;
       }

       // Find the last space within the current screen width
       int lastSpace = -1;
       for (int i = start; i < end; i++) {
           if (text[i] == ' ') {
               lastSpace = i;
           }
       }

       if (lastSpace != -1) {
           // If a space is found, break at the space
           printf("%.*s\n", lastSpace - start, text + start);
           start = lastSpace + 1; // Skip the space
       } else {
           // If no space is found, truncate at screen width
           printf("%.*s\n", screenWidth, text + start);
           start += screenWidth;
       }
   }
}

int main() {
   const char *text = "Thisisaverylongstringwithnospacesthatneedstobetruncatedproperly.";
   int screenWidth = 20; // Example screen width

   printWrappedText(text, screenWidth);

   return 0;
}


I then tested this with different strings on https://www.programiz.com/c-programming/online-compiler/ which is a great resource for fast testing of C code
The program worked perfectly so with a bit of modification to fit into MMBasic this will be in the next release.
 
     Page 29 of 36    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025