Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:55 02 Aug 2025 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 : A very BASIC question

     Page 2 of 2    
Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 12:18pm 20 Jul 2022
Copy link to clipboard 
Print this post

  PeterB said  When I LOAD XXXXX$ or variations of it

I get "can't open file".


Loading from a variable apparently doesn't work (I don't know why that needs to be the case). But loading a quoted string does.


PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 11:02pm 20 Jul 2022
Copy link to clipboard 
Print this post

  Quote  If by decent weather you mean unbearable heat then you are welcome to it. I'm Northern European, please send me regular rain and temperatures in the 10-20 'C range.


I can offer you views of the snow on the hills from the kitchen window and crunchy ice on the puddles in the driveway yesterday at 10am.
The wife loves the heated seats in the car...

Jim
VK7JH
MMedit
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 09:33am 21 Jul 2022
Copy link to clipboard 
Print this post

Tom, Lizby et al.

That does it. "G9.BAS"

When I try to RUN I get a message that g9_display.txt will not run.

I don't think that is important.

I will now tidy up the method, laminate it and nail it to my wall.

But thanks to you lot I am well on the way.

When English people started migrating here in the 50s, they were told that the average temp. is 25 degrees. They were not told that it is zero for 6 months and 50 for 6 months.

Peter(B)
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 12:03pm 21 Jul 2022
Copy link to clipboard 
Print this post

  PeterB said   "G9.BAS" . . .
When I try to RUN I get a message that g9_display.txt will not run.


I didn't remember having posted g9.bas. What's the date on that?

Anyway, here's the latest version of g9_display.txt (zipped because of above CHR$(127) codes, which might not display properly). Coding is Code Page CP-437. MMBasic for Windows will properly print IBM graphics characters in CP-437 coding.

g9_display.zip

G9.bas will need to be changed to point to wherever you put g9_display.txt.

Once unzipped into your directory, this will print the file:

OPEN "g9_display.txt" for input as #1
do: line input #1,a$: ?a$: loop until EOF(#1)
CLOSE #1




(Note: this exact code also works in MMBasicDOS.)

~
Edited 2022-07-21 22:43 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 12:11am 22 Jul 2022
Copy link to clipboard 
Print this post

Thanks Lizby

'MMEDIT!!! Basic Version = CMM2
'MMEDIT!!! Port = :10,300
'MMEDIT!!! Device = CMM2

'  ===========================================================
'  GEOTHERMAL CONTROL PROGRAM        GCP.BAS V1.00g 06/20/2022
'             BY: PAUL LEPKOWSKI & LANCE BENSON

And I thought I was nearly there.

I have much to do but the oncoming light may not be a train.

I have to do the shopping this morning.

Peter(B)
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 10:12am 25 Jul 2022
Copy link to clipboard 
Print this post

Tom, Lizby et al.

After taking a few days off to do "girly" things I have returned to my problem.
I can now flip Pico pins using TeraTerm or MMBASIC. I have yet to read a pin but given my enormous intellect that should only take about 30 years.

I got into all sorts of problems particularly with the various versions of MMBASIC.
Do you younger blokes experience this?

But after all my trials and tribulations I am up and running with a Pico. connected to a WIN 7 or WIN 10 PC. I have yet to try LINUX.

Thanks for your help

Peter(B)
 
pwillard
Guru

Joined: 07/06/2022
Location: United States
Posts: 313
Posted: 11:56am 25 Jul 2022
Copy link to clipboard 
Print this post

  Quote  I got into all sorts of problems, particularly with the various versions of MMBASIC.
Do you younger blokes experience this?


Just you... no wait... I have this problem all the time.  ;-P
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 01:43pm 25 Jul 2022
Copy link to clipboard 
Print this post

Hi Peter,

  PeterB said  I got into all sorts of problems particularly with the various versions of MMBASIC. Do you younger blokes experience this?


The subtle differences between MMBasic versions can be rather a nuisance it's true - plus there are so many different betas floating around. The existence of both MMBasic for DOS and MMBasic for Windows (MMB4W) also confuses matters as they are significantly different with MMB4W being part of @matherp's newer MMBasic family.

Fortunately TBS is a really helpful group and @matherp is a (somewhat kranky) MMBasic developing machine .

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 02:17pm 25 Jul 2022
Copy link to clipboard 
Print this post

  PeterB said  I can now flip Pico pins using TeraTerm or MMBASIC. I have yet to read a pin


Congratulations. That's a good part of the battle. Here's how to read a DS18B20 temperature sensor attached to the PicoMite talking to MMBasic for Windows over serial.

(Note--in order to get long lines to work, I set MODE 9 and FONT 1. Any error message changes the font, so if you are fiddling and get errors, you may need to repeatedly set FONT 1.)



The code is:
dim string a$,QT=34 ' scratch variable a$ and double-quote
dim integer i
open "com7:115200" as #1 ' change to suit your COM port
print #1, "? "+QT+"! "+QT+"; tempr(10)" ' this says print "!" and temp from pin 10
do: line input #1,a$: if mid$(a$,1,1)="!" then: print "Temperature: ";val(mid$(a$,4,2)): exit: endif: loop
a$=input$(255,#1) ' clear the serial buffer
close #1


"Temperature: 23" gets printed.

Note that I put the "DO" loop all on one line so that it could be typed at the ">" prompt. In a program, you would unroll the DO for legibility and so you could add comments. Reading a pin would be similar. After setting it up with SETPIN, you would do "print #1, "? "+QT+"! "+QT+"; pin(1)" (for instance).

I put the PRINT "!" in to make it easier to pick out the line containing the returned temperature reading.

I just noticed that you can use VAL(MID$(a$,2)) instead of VAL(MID$(a$,4,2)) and it will ignore leading spaces and give you any decimal places, e.g., 23.75.

~
Edited 2022-07-26 00:26 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 12:22am 26 Jul 2022
Copy link to clipboard 
Print this post

Thanks Lizby etc.

I will now get started understanding your code.

Peter(B)
 
     Page 2 of 2    
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025