Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:42 25 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 : New Version of MMBasic. Version 3.1

     Page 1 of 2    
Author Message
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 09:24am 27 Jan 2012
Copy link to clipboard 
Print this post

A new version of MMBasic (ver 3.1) is available for download from: http://geoffg.net/maximite.html#Downloads

This version introduces three significant advances:

- Defined Subroutines. These are a modern programming feature that allow you to define a subroutine and call it (with arguments) just as if it was a command built into the language. This is an important programming feature and the attached tutorial shows how to use them. 2012-01-27_192018_Defined_Subroutines.zip

- Added the 1-wire protocol (thanks to Gerard Sexton).

- MMBasic 3.1 now supports the DuinoMite. This includes all the advanced features of 3.1 such as optional line numbers, the full screen editor and defined subroutines. There are some limitations due to hardware issues, the primary one is that only 12 I/O pins are supported but otherwise all the standard Maximite features like VGA, USB, SD card and so on are supported. Future versions of DuinoMite MMBasic will be released simultaneously with the Maximite and UBW32 versions and this means that there will be no software differences between all three platforms.


I would like to thank the Beta Test team for their help and particularly Fabrice Muller, John Wettroth and Hugh Buckle who provided valuable feedback and bug detection. Also a large thanks to Bruce Mitchell who spent hours going through the new language manual and found and corrected numerous errors.

The MMBasic User Library (at http://geoffg.net/maximite.html#Downloads) is now being managed by Hugh Buckle and he has updated it to include examples of using defined subroutines and the 1-wire protocol. The library is a great resource for beginners and experts alike so, if you have written a program for MMBasic and you believe that it is worth sharing, please send it to Hugh at mmlib@geoffg.net and he will add it in. We are looking forward to many interesting submissions.

The Change Log (included in the update download) details the changes and the MMBasic Language Manual (also included in the download) has been updated to include the new features listed above.

Geoff

Geoff Graham - http://geoffg.net
 
crackerjack

Senior Member

Joined: 11/07/2011
Location: Australia
Posts: 164
Posted: 09:43am 27 Jan 2012
Copy link to clipboard 
Print this post

This is wonderful news Geoff. MMBasic is maturing very rapidly into an enviable development and prototyping vehicle for the Maximite and friends. Defined subroutines are extremely powerful constructs for reuse and for a robust code structure.

Thanks a stack! I'm off to download the update...
 
jwettroth

Regular Member

Joined: 02/08/2011
Location: United States
Posts: 71
Posted: 09:52am 27 Jan 2012
Copy link to clipboard 
Print this post

Thanks Geoff and thanks so much for mending this fence and re-uniting our funny little world! I love this little computer and it now has more fun potential than ever. I'll be ordering an Duinomite tomorrow.

My MM is setup measuring several temperatures with 1 wire- very cool. I'm going to dedicate a CGMSTICK and an LCD to this task and put in a nice little box.

Keep up the fun,

John Wettroth
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 11:10am 27 Jan 2012
Copy link to clipboard 
Print this post

Thank you Geoff!
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 11:30am 27 Jan 2012
Copy link to clipboard 
Print this post

BEWDY Newk

VK4MU MicroController Units

 
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 11:51am 27 Jan 2012
Copy link to clipboard 
Print this post

Geoff you & can I now say "your team" are full of surprises, here I was waiting patiently for 3.1 with 1-WIRE but you also included the subroutine capability.

I've had a quick look at the revised code for LCD & 1WIRE using subroutines & this really demonstrates the plus of having that enhancement.

Thanks guys
RayB from Perth WA
 
Vikingboy
Regular Member

Joined: 23/09/2011
Location: Australia
Posts: 82
Posted: 03:35pm 27 Jan 2012
Copy link to clipboard 
Print this post

Hi,

Just updated to 3.1, my mm.ver is still reading 3.01 , tested the sub command and is definitely 3.1, must not have updated the vers number.

Really great update BTW :)

AndrewEdited by Vikingboy 2012-01-29
 
Olimex
Senior Member

Joined: 02/10/2011
Location: Bulgaria
Posts: 226
Posted: 04:22pm 27 Jan 2012
Copy link to clipboard 
Print this post

Well done!

Geoff, Ken is going to upload on Github the DM sources with all DM features implemented so far in few days, feel free to check/test/include in further MM releases when you have time.
 
Olimex
Senior Member

Joined: 02/10/2011
Location: Bulgaria
Posts: 226
Posted: 04:41pm 27 Jan 2012
Copy link to clipboard 
Print this post

I just read this:

"Disclaimer: This version of MMBasic has been tested on an early prototype provided by Olimex but there may be subtle differences in the newer hardware that I have not found."

I will send you set of latest DuinoMite boards as yours were prototypes built in September for the Silicon Chip article.
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 09:34pm 27 Jan 2012
Copy link to clipboard 
Print this post

  Olimex said   I just read this:

"Disclaimer: This version of MMBasic has been tested on an early prototype provided by Olimex but there may be subtle differences in the newer hardware that I have not found."

I will send you set of latest DuinoMite boards as yours were prototypes built in September for the Silicon Chip article.

Great Idea

VK4MU MicroController Units

 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 10:01pm 27 Jan 2012
Copy link to clipboard 
Print this post

Has anyone found the way MMBasic uses spaces to be annoying?

Some commands without spaces give an error but in other places, a space causes an error.

eg.

pixel (10,10)=1 does not work.
pixel(10,10)=1 does work.

I thought BASIC was suppose to ignore spaces. You can put them in if you want them, leave them out if you don't.

 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 10:06pm 27 Jan 2012
Copy link to clipboard 
Print this post

I have found that also annoying.
1 solution maybe at next revision
the tokeniser adds an extra space after the keyword if there is none there and 1 is needed

ie. Pixel(0,0)=1 becomes pixel (0,0)=1
Edited by djuqa 2012-01-29
VK4MU MicroController Units

 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 10:17pm 27 Jan 2012
Copy link to clipboard 
Print this post

  djuqa said   I have found that also annoying.
1 solution maybe at next revision
the tokeniser adds an extra space after the keyword if there is none there and 1 is needed


That would be good, forcing a space (or taking away extra spaces?) inorder to keep the code looking consistent.

I also find the Uppercase/Lowercasing weird but that's probably from my old school BASIC heritage.

I personally like uppercase for all commands, keeps the screen consistent and clear what is a command... but thats my old school opinion.
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 11:49pm 27 Jan 2012
Copy link to clipboard 
Print this post

I've never used a space within commands that have variables within brackets. Commands like LOCATE(x,y), SET(x,y) etc are like using arrays, subs or functions, there is never a space. The command LOCATE is really LOCATE( with some variables and a closing bracket at the end. I do think its correct for MMBasic to throw an error with PIXEL (x,y), and work fine with PIXEL(x,y), but I've used many versions of BASIC and thats always been the standard. Also, other commands need to see spaces between options. Spaces are part of the syntax, in some situations they can cause errors and in others they can be ignored, its just a case of knowing the syntax.

Once you get into the higher languages using dot(.) notation, spaces are critical.

I do agree with uppercase for commands, and any case for variables. The way MMBASIC automatically converts lower case commands to uppcase is perfect.

I think this should be started as a new post, we're getting off topic here.

Glenn
Edited by Gizmo 2012-01-29
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
marcwolf

Senior Member

Joined: 08/06/2009
Location: Australia
Posts: 119
Posted: 12:22am 28 Jan 2012
Copy link to clipboard 
Print this post

Brilliant, brilliant

With the Defined Subroutines it opens up a way to do libraries of useful code that can be slotted into existing programs.

For example a GPS library would be very easy to implement so that anyone can download it and share. Likewise a library for Servos etc.

Again thanks for thie great development

Dave
Coding Coding Coding..
Keep those keyboards coding..
RAW CODE!!!!!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 02:02am 28 Jan 2012
Copy link to clipboard 
Print this post

Thanks for all the wonderful comments. I have some friends who ask "why do you spend so much time on this?" Perhaps I should print out this thread to show them.

There are a few responses that I thought that I should answer in a batch:
  Vikingboy said  Just updated to 3.1, my mm.ver is still reading 3.01 , tested the sub command and is definitely 3.1, must not have updated the vers number.

This is the correct version number. mm.ver uses TWO digits for the minor number. The manual explains it a little better.

  Nick said  I also find the Uppercase/Lowercasing weird but that's probably from my old school BASIC heritage.

I personally like uppercase for all commands, keeps the screen consistent and clear what is a command... but thats my old school opinion.

I could see that being a problem (I like all uppercase also) so I put in the CONFIG CASE UPPER command. You only have to do it once and it will be remembered, even with the power off.

  marcwolf said  With the Defined Subroutines it opens up a way to do libraries of useful code that can be slotted into existing programs.

For example a GPS library would be very easy to implement so that anyone can download it and share. Likewise a library for Servos etc.

Yes, yes, exactly. Lets have lots of good software modules.

  Olimex said   I just read this:

"Disclaimer: This version of MMBasic has been tested on an early prototype provided by Olimex but there may be subtle differences in the newer hardware that I have not found."

I will send you set of latest DuinoMite boards as yours were prototypes built in September for the Silicon Chip article.

Thanks very much Tsvetan - that would be brilliant.

Geoff

Geoff Graham - http://geoffg.net
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 02:12am 28 Jan 2012
Copy link to clipboard 
Print this post

  Geoffg said  
I could see that being a problem (I like all uppercase also) so I put in the CONFIG CASE UPPER command. You only have to do it once and it will be remembered, even with the power off.


Brilliant. Now it looks like BASIC...well, at least for us old dogs.

Can I suggest adding a LOADBMP command in rev 3.2 Geoff?
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 02:16am 28 Jan 2012
Copy link to clipboard 
Print this post

  Nick said  Can I suggest adding a LOADBMP command in rev 3.2 Geoff?

I was thinking of that but I have been concerned about upsetting the good work others have done with their BASIC versions.

Comments anyone?
Geoff Graham - http://geoffg.net
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 02:24am 28 Jan 2012
Copy link to clipboard 
Print this post

I think if the new MMBAsic can use libraries, then thats covered. The SHOWBMP.BAS program included with the sample files could be used as a defined subroutine.

Finding the balance between the byte count of implementing a feature into MMBasic, versus how often it would get used, is always going to be difficult. To some, a feature like displaying BMP's would be great, but to others it would never get used.

But as part of a library, well, it would be like building your own version of MMBasic

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 02:48am 28 Jan 2012
Copy link to clipboard 
Print this post

A loader written in BASIC will always be slow. Depending on the amount of detail, it can still take over 5 seconds to load.

I have been using crackerjack's MPF format that cuts it down but still not as fast as a routine built in to the firmware as a command written in C.

A game I am writing for the MM requires the loading of a screen and it looks crap watching it load each time. Slows development time down too.
 
     Page 1 of 2    
Print this page
© JAQ Software 2024