Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:47 27 Nov 2024 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 : (MM) MMBasic User Program Library

Author Message
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 12:28am 22 Jan 2012
Copy link to clipboard 
Print this post


For those who haven't found it yet, there is a User Program Library for MMBasic programs which you can download from Geoff Graham's web site at http://geoffg.net/maximite.html. He has asked me to maintain it for him to give him more time to concentrate on development. The library won't be moving; I will update the .zip file and send it to Geoff to upload.
There are a number of programs already there, but it could do with many more. Altronics has sold in excess of 1000 Maximite kits, so there are a lot of people doing interesting things with this little gem.
If you are one such person and you have a program you think others might be interested in, please send it to mmlib@geoffg.net. Please include either in comments within the program or in the accompanying email, a brief description and, if you have ported the code from elsewhere, please acknowledge the source. Some email servers reject program attachments such as .BAS so it is best to append .TXT to the filename.
At present the User Library contains programs which have featured in Silicon Chip articles, games including Space Invaders (which is by far the largest program there so far and has had lots of enthusiastic response on this forum), applications, tools, techniques and demonstrations of MMBasic and Maximite/mini-Maximite features. Some of them are control and monitoring applications which require external hardware and in most cases the relevant schematics are there too. Browse the ReadMe.pdf in the library for details.
As for programming standards, if it works, it's OK, but it would be nice if it were written in structured code (to make it easier to understand and to modify), without line numbers and liberally sprinkled with helpful comments, as many people will try and learn from your work by understanding its logic and coding techniques. Don't be surprised if people offer you enhancements.
Each time MMBasic is updated I will attempt to test the library programs, but the onus will be on you to ensure that it still works. If it falls over, I will try and contact you for an update, but please don't wait for my email. I won't be able to test programs using external hardware.
If you find a problem with a program in the library, let me know through mmlib@geoffg.net and I will try and pass it on to the author.
We look forward to adding your gem to the library. Why not do it now before you get too embroiled in your next project.
Cheers,
Hugh

 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 12:29am 10 Feb 2012
Copy link to clipboard 
Print this post

Hi,
An update to the MMBasic User Library should be on Geoff's web site shortly. It contains:
* BIGINT.BAS, a demo which shows how MMBasic can handle large integers
* Another incarnation of the Magic Switchboard - MAGICSW2.BAS
* A routine to find the day of week for any date - DATE_DAY.BAS
* An update to LCD.BAS to handle larger displays
* A couple of minor updates to BATTERY.BAS and BATTERY2.BAS

In the next version I would like to start a category for Defined Subroutines, so if you have any that you think others might find useful, please send them to me at mmlib@geoffg.net.
Cheers,
Hugh
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 1344
Posted: 09:35am 10 Feb 2012
Copy link to clipboard 
Print this post

G'day Shoebuckle,
Good to see your on working with the Maximite and keeping it up to date. Last year I spent close on 3 weeks every night making an online help system so users with a simple F1 can bring up the help file then simply go 'help "whatever' then the screen will refresh with that command or function with code examples and leave the program memory intact. Now this has been taken up by the Duinomite developers and as of yet it isn't on the Maximite.

Personally I would of hoped this help file system would of taken off for both flavors but the Maximite has ignored it totally. I am sure if the Maximite can take on this help file system as it is open source it can become a great online tool for every user of both the Duinomite and the Maximite. Ken did the firmware changes and I'm sure he will provide the code. Now the more people that work on this help file the better it will become and I have said well this is my first major project and the world is welcome to it so it really has me beat why the Maximite hasn't taken it on.

Regards Bryan
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 10:39pm 10 Feb 2012
Copy link to clipboard 
Print this post

Bryan,
I have passed your message on to Geoffg as I only look after the User Library for him.
Cheers,
Hugh
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 01:08am 12 Feb 2012
Copy link to clipboard 
Print this post

James_from_Canb has raised the question of naming standards in a couple of other threads and, since I plan to create a category for Subroutines in the User Library, now would be a good time to talk about it.

Subroutines need to have filename and label conventions that make them identifiable as a piece of included (Merged) code. Here is a suggestion which I am sure will provoke some discussion.

a) Subroutines, defined or otherwise, should not use line numbers. This eliminates the problem of duplicating line numbers in other subroutines and in the rest of your program.
b) The filename extension be .SUB
c) The filename for text function start with $ (e.g. $Swap.sub)
d) The filename for numeric function start with # (e.g. #Swap.sub)
e) The filename for function which is not specifically text or numeric start with ! (e.g !mysub.sub)
f) Subroutine name (label) be the same as the filename (e.g. Sub $Swap A$,B$ ... End Sub). This will clearly identify it as merged code within your program and eliminates the problem of duplicating a reserved word.
g) The subroutine code should have comments at the top which explain the calling sequence and return value(s).

So, in these examples you would
Merge "$Swap.Sub" or Merge "#Swap.Sub" or Merge "!Mysub.sub"
with your code as required.

Over to you for comment, suggestions.
Hugh
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 11:43am 12 Feb 2012
Copy link to clipboard 
Print this post

That's well thought out Hugh.
There may be problems with libraries of subs though.
The user may use a variable name or sub name in their code that is also in the library. I've tried to get around this by having LCD in each sub name. That's because I assume the user will name their subs after the function they are performing, and displaying info on an LCD is a minor function that's unlikely to get its own sub. I also use variable and sub names that are unlikely to be performed by the user, especially if there's one on the library that does the job.

I'll wait a couple of days to see if there are any comments before I convert lcd_lib.bas

Btw, I've noticed that moving code between different editors is a pain if the tab sizes are different. I've converted all tabs to spaces and now have no formatting problems. If multiple people are working on the same code it might be worthwhile not using tabs. That assumes people have editors that can convert the tab character to spaces on the fly.

James
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 10:07pm 25 Feb 2012
Copy link to clipboard 
Print this post

There is an update to the User Program library at http://geoffg.net/maximite.html. In it you will find:
* Raros' Sudoku
* YT2059's DIVTEST - a division practice tool for 6 year olds
* BENCHMRK programs ported by CircuitGizmos from 1977 Personal Computer World
* Theo Reimer's DATE-DAY which returns the day-of-week for any date
* Update to MAXIFONT from Dennis Wyatt that now detects MMBasic version
* Update to LCD from James Deakins that should support larger displays

I haven't created a Subroutine library yet as my proposed naming convention just wouldn't work. Hopefully I will have a solution for the next update.

In the meantime, have fun.
Cheers,
Hugh
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 01:00pm 20 Jul 2012
Copy link to clipboard 
Print this post

Geoff has just uploaded an update to the user library at http://geoffg.net/maximite.html. A couple of things added:
* Numbers: a simple maths practice program for children
* PWM: a highly configurable PWM program
Cheers,
Hugh
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 12:42pm 25 Oct 2012
Copy link to clipboard 
Print this post

With Geoff sunning himself in Italy, we cannot update his downloads page but, thanks to Djuqa, you can retrieve the latest version (24 Oct 2012) from the Maximite site maximite.com.au.

Library file: http://32bit.com.au/downloads/MMBasic%20Library%2024-Oct-201 2.zip

Library page: http://maximite.com.au/the-news/51-mmbasic-library.html

Latest updates are:
* HexDump from Doug Pankhurst which dumps a text file to the screen in hex and ascii. Useful for analysing a text file contents. An alternative to TEXTLOOK.
* CVanBM, a method of monitoring the status of a caravan battery and solar charging system also from Doug Pankhurst
* A small update to MUSIC.bas to correct a bug.
* SString, TassyJim's code, which has appeared in The Back Shed, that demonstrates a way of storing small strings efficiently.

Cheers,
Hugh
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 12:32pm 07 Jun 2013
Copy link to clipboard 
Print this post

The Maximite User Library has just been updated with a couple of programs:
- CRUNCH to reduce the size of a program and speed it up.
- RENUMBER with some enhancements.

James_From_Canb has reworked the Renumber program which was originally in the library but which was removed when MMBasic contained a renumber command. Now that the command is no longer in MMBasic, those who use line numbers will find this utility useful. In his ReadMe file, James says:

"The program has some enhancements compared with the older versions.
- a line out-of-order check. A priority, because out-of-order lines caused an embarassing bug for me a while back;
- it ignores potential labels and line numbers if they are within remarks or print statements;
- it attempts to indent based on the length of the longest line number (but see problems below);
- it has options to increment the line numbers, even if the line number is blank, and to add line numbers to blank lines;
- it has some extra validation checks;
- it stores your preferred values in a configuration file."

It can also invoke FORMAT once it has finished renumbering, which is why the Format program has been included in the Renumber folder.
Cheers,
Hugh
 
Print this page


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

© JAQ Software 2024