|
Forum Index : Microcontroller and PC projects : MMBasic V6.03.00 release candidates
| Author | Message | ||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11313 |
Like this? |
||||
| JanVolk Guru Joined: 28/01/2023 Location: NetherlandsPosts: 349 |
Test PicoMite MMBasic RP2040 V6.03.00RC2 with F12. Note line 5. > list ' Traffic light. SetPin GP13, DOUT ' YELLOW via 470 ohm resistor to GND. SetPin GP14, DOUT ' RED via 470 ohm resistor to GND. SetPin GP15, DOUT ' GREEN via 470 ohm resistor to GND. ' On the LED ( = Anode(+) and | = Cathode(-). Const ON = 1 ' 1 = ON or 3V3 / 3.3V on pin. Const OFF = 0 ' 0 = OFF or 0V / GND on pin. Do Pin(GP14) = ON ' RED Pin(GP13) = OFF ' YELLOW Pin(GP15) = OFF ' GREEN Pause 10000 ' Wait 10 seconds. Pin(GP14) = OFF ' RED Pin(GP13) = OFF ' YELLOW Pin(GP15) = ON ' GREEN Pause 10000 ' Wait 10 seconds. For A = 1 To 5 ' Flash loop 5x 0.5 seconds. Pin(GP14) = OFF ' RED Pin(GP13) = ON ' YELLOW Pin(GP15) = OFF ' GREEN Pause 500 ' Wait 0.5 seconds. Pin(GP14) = OFF ' RED Pin(GP13) = OFF ' YELLOW Pin(GP15) = OFF ' GREEN Pause 500 ' Wait 0.5 seconds. Next A Loop > > edit F12 and Y > list ' Traffic light. SetPin GP13, DOUT ' YELLOW via 470 ohm resistor to GND. SetPin GP14, DOUT ' RED via 470 ohm resistor to GND. SetPin GP15, DOUT ' GREEN via 470 ohm resistor to GND. ' On the LED ( = Anode(+) and | = Cathode(-). Const ON = 1 ' 1 = ON or 3V3 / 3.3V on pin. Const OFF = 0 ' 0 = OFF or 0V / GND on pin. Do Pin(GP14) = ON ' RED Pin(GP13) = OFF ' YELLOW Pin(GP15) = OFF ' GREEN Pause 10000 ' Wait 10 seconds. Pin(GP14) = OFF ' RED Pin(GP13) = OFF ' YELLOW Pin(GP15) = ON ' GREEN Pause 10000 ' Wait 10 seconds. For A = 1 To 5 ' Flash loop 5x 0.5 seconds. Pin(GP14) = OFF ' RED Pin(GP13) = ON ' YELLOW Pin(GP15) = OFF ' GREEN Pause 500 ' Wait 0.5 seconds. Pin(GP14) = OFF ' RED Pin(GP13) = OFF ' YELLOW Pin(GP15) = OFF ' GREEN Pause 500 ' Wait 0.5 seconds. Next A Loop Jan. Edited 2026-05-07 04:56 by JanVolk |
||||
| toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 618 |
OK, which of these two is the case? In the filename "01.MyBASICProg.bas" A. The filename is 01 and the extension is MyBASICProg.bas B. The filename is 01.MyBASICProg and the extension is .bas In MS-DOS and Windows, B is the answer. Asking for a friend... ![]() Edited 2026-05-07 05:15 by toml_12953 |
||||
| homa Guru Joined: 05/11/2021 Location: GermanyPosts: 580 |
Please don't ;-) Why else do we have BASIC for writing our own programmes? ;-) @javavi: This command is very interesting for that: ![]() Matthias |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4316 |
For calculations, at the prompt I just use ? expression John |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11313 |
That is what it does. Don't like it, don't use it. There is no right answer. The first . character in the filename is treated as the start of the extension. If there is already an extension defined then .bas isn't added. This won't be changing That doesn't deal with carrying forward the answer as in Javavi's example and my response Edited 2026-05-07 07:50 by matherp |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3191 |
For years I have been using:- > x=5*2 :?x 10 > ?x+10 20 > ' or > x=x+10 :?x 20 > It is a bit more typing, though in TeraTerm the " :?x" can be held on the clipboard (highlight with mouse) and applied at the end of every line with Alt-V Edited 2026-05-07 08:22 by phil99 Footnote added 2026-05-07 08:41 by phil99 And JohnS has reminded me (see below) the up arrow can save some typing on PicoMites. |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4316 |
Then I'd use x = expression I probably do it a few times a month at most so I don't need any more of an embedded calculator but maybe others have a need? If I'm using MMB4L I don't even need to use the above as you can hit uparrow (as many times as you like) and reuse the existing expression(s). John Edited 2026-05-07 08:24 by JohnS |
||||
| toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 618 |
Is there any way to get lines longer than 40 characters LISTed on a PicoCalc? I have a serial printer hooked up and can LIST a program to the serial port but it still wraps at 40 columns even though the printer is an 80-column printer. |
||||
| homa Guru Joined: 05/11/2021 Location: GermanyPosts: 580 |
JohnS, javavi, It was meant to be a hint about the possibility of programming a miniCalc yourself I had the command to hand because I’d been thinking about a ‘programmer’s pocket calculator’ over the last few days. I just don’t think something like that belongs in the firmware anymore! Just my two cents. Matthias Mini example, without error handling, without parsing the input, etc.: CLS Font 1 Dim integer r% Dim string i$ Do Input "Calc ";i$ r%=Eval(i$) Print r%, Hex$(r%), Bin$(r%,16) Loop Calc ? 2+3*4 14 E 0000000000001110 Calc ? sin(pi/2) 1 1 0000000000000001 Calc ? |
||||
| terekgabor Regular Member Joined: 02/01/2026 Location: HungaryPosts: 73 |
I recommend and use the same. This is Eval. I use also On error skip with it, then I can handle alarms without stopping the program (for example syntax, divude by zero, etc.) G@bor |
||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 1089 |
...I'm not sure if this has been mentioned before: When you try to open files in the Text Viewer that are smaller than or equal to one page, the Text Viewer closes immediately and you can't view them. Would it be possible to make it so that the viewer closes only when you press ESC? Frank (P.S.: Tested with PicoCalc and PicoMiteRP2350V6.03.00RC2) |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11313 |
Frank, will fix. Please could you look at my post on the Question about astro thread |
||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 1089 |
Peter, I'd really like to check that out tonight. Frank |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11313 |
V6.03.00RC3 PicoMiteRP2040V6.03.00RC3.zip PicoMiteRP2350V6.03.00RC3.zip Listing a short file in FM now requires a keypress before exiting the listing to avoid it disappearing immediately Expermental add-ons All versions: Calculator immediate mode at the command prompt. Type in calculations and you will get the answer no need for a question mark. The answer will also be stored in a variable MM.ANSWER allowing follow-up calculations. This code is 1: trivial and 2: only gets executed after all normal command line processing has failed, so it should be benign and I will certainly find it useful as well as hopefully javavi RP2350 versions: SLEW command GPS_Astro_Reference.pdf Edited 2026-05-07 18:53 by matherp |
||||
| terekgabor Regular Member Joined: 02/01/2026 Location: HungaryPosts: 73 |
Peter! Fantastic again, thank you! What do you think can somehow solve to use string variable to give object name for Astro and Star command? G@bor |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11313 |
Will do |
||||
| terekgabor Regular Member Joined: 02/01/2026 Location: HungaryPosts: 73 |
Thanks a lot! G@bor |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 471 |
Peter, occasionally I get an error in the new calculator mode, e.g. > sqr(2) Error : MM.ANSWER is not declared can dim mm.answer as integer, calc-mode works then and it turn up as a float variable which makes sense. Currently I'm not able to reproduce it consistently. Env.: PicoMite MMBasic RP2350B V6.03.00RC3 Edited 2026-05-07 22:13 by ville56 73 de OE1HGA, Gerald |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11313 |
Caused by OPTION EXPLICIT - easy fix for next RC |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |