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 : Calling other code with MMBasic
Author | Message | ||||
Keith @ Senior Member Joined: 19/06/2011 Location: AustraliaPosts: 167 |
To the software Gurus .... Is it possible (by modifying MMBasic) to do calls of other software code from within MMBasic? (I know it can be done with VB calls of C++ DLLs) For example ... if there is a C program (Arduino) to run a particular piece of hardware but this hardware hasn't been coded for in MMBasic would it be possible to run the code by calling it from within MMBasic (suitably modified to account for the idiosyncrasies of the Maximite/Duoinmite and the shield or component being used). Keith The more we know, the more we know we don't know ! |
||||
crackerjack Senior Member Joined: 11/07/2011 Location: AustraliaPosts: 164 |
Tricky indeed. Does this piece of code expose some calling convention? What is the interface? Could the other code be accessed via some serial interface a la I2C or SPI? |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3800 |
Yes it can be done. I don't think it's there yet. I guess someone could add it and I think the important thing would be working out the syntax etc. Something like CCALL <var>(<args>) where <var> is a string with the code inside it and <args> are the data to pass across. hmm, it should be able to return a value. x = CFUNC(<var>, <args>) maybe? Other Basics have it.... go find one whose syntax you like :) Then add it into MMBasic. Get Geoff's view on this!! It would be useful to be able to load the <var> from a file. John |
||||
donmck Guru Joined: 09/06/2011 Location: AustraliaPosts: 1313 |
Along similar lines, we have wish list 36 sitting there. Wish 36: Help system via SD card. Either HELP "command" or HELP "command"/? What a delight it would be to have a help system file on the SD card, and be able to access the text with some simple commands. I'm sure users would easily put together the required text system. It is linking into MM-basic that requires the real work. I feel it must be time to point members at the polls again: http://www.themaximitecomputer.com/wish-list-priority-level- poll/ Cheers Don... https://www.dontronics.com |
||||
trippyben Regular Member Joined: 26/06/2011 Location: AustraliaPosts: 91 |
I Guess you could include the required piece of code in the maximite source code, give it a name and format to match MMbasic, recompile it yourself and it could be called just by using the name given to it just as if it was originally included in mmbasic. (Much like some early user mods for I2C etc.) |
||||
Print this page |