|
Forum Index : Microcontroller and PC projects : EXECUTE command$
| Author | Message | ||||
| PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 1751 |
Looks like it could be useful but how is it used.... typically? Is it a more efficient approach than something else? I have the feeling that I'm missing-out |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3634 |
I'm using it right now in a program with video output so that a user can arbitrarily inject a command, especially for debugging, by typing at the console, e.g., "!test Execute print a$, b$, c$" or "!test EXECUTE someSubroutine. It can also be useful for injecting a command into a 2nd connected Picomite. Here's a program from some years back in which a picomite connected to a primary picomite receives serial (while perhaps running a program, not just listening) and in addition to executing canned routines on command, can submit EXECUTE some command if sent, say, "! some command": serial control of 2nd Picomite. Note: it cannot be multiple commands separated by ":". PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3042 |
I think the Port command and function still require literal GP pin numbers, so to use a string variable for the Port command and function you need EXECUTE. Eg. from keypad program. For n=RowPinGP To RowPinGP+rows-1 SetPin MM.Info(pinno "GP"+Str$(n)),DOUT 'set the Port out pins Next For n=ColPinGP To ColPinGP+Cols-1 SetPin MM.Info(pinno "GP"+Str$(n)), INTH, Key.Pad, PULLDOWN 'set the Port input pins and ISR Next '... Execute "Port(GP"+Str$(RowPinGP)+",rows) = 1 << y" 'set the row to read Execute "x=Port(GP"+Str$(ColPinGP)+",cols)" 'read the columns Though in the latest firmware you could probably simplify that a bit. |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |