Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 22:10 01 May 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 : dim var as byte

     Page 2 of 16    
Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5732
Posted: 09:55pm 02 Aug 2022
Copy link to clipboard 
Print this post

Yes - you can stuff arrays at the DIM statement.

DIM a(4)=(0,1,2,3,4)
will work.

DIM a(4)
a=(0,1,2,3,4)
will not work as a() and a are different variables but have the same name. You'll get an error.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 09:55pm 02 Aug 2022
Copy link to clipboard 
Print this post

  stanleyella said  It seems the manual is wrong

You can't do
DIM a(4)
a=(0,1,2,3,4)
from the manual
Arrays can also be initialised when they are declared by adding an equals
symbol (=) followed by a bracketed list of values at the end of the
declaration.

The manual looks correct - but your two lines don't do what it says.

John
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 1647
Posted: 09:57pm 02 Aug 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  The PicoMite has 16 colours (including black and white). You can easily set up whatever colour names you want:
CONST pink=RGB(255,150,150) 'or something like that - I've not checked

8 predefined in mmedit not 16
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8591
Posted: 09:58pm 02 Aug 2022
Copy link to clipboard 
Print this post

  Quote  It seems the manual is wrong


It isn't
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5907
Posted: 10:37pm 02 Aug 2022
Copy link to clipboard 
Print this post

  stanleyella said  
8 predefined in mmedit not 16

The help file in MMEdit that mentions 8 predefined colours also states that the 8 colours are for the CMM version 1 - 10+ years old.

Later versions of MMBasic have more predefined colours.
Different devices can display a different number of colours at the same time.
In many cases you can use colours other than the defined colours by using RGB to specify the 3 colour values.

The help files in MMEdit are trying to cover all versions of MMBasic for an ever increasing number of different devices.
I haven't kept up with it.
I will never keep up with it, especially on an old version of MMEdit.

Please refer to the manuals for the device you are using (and start with some simple code snippets until you understand the basics). It will make your life much easier.

Jim

PS The reason BYTE appeared as a keyword is because it is used in the PEEK and POKE commands.
VK7JH
MMedit   MMBasic Help
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 10:43pm 02 Aug 2022
Copy link to clipboard 
Print this post

  stanleyella said  So would this work?


Why not try these things in MMBasic for Windows, if you don't have a PicoMite handy.

But as said multiple times, MMBasic doesn't support multi-line statements.

You can do this:

> new
> option list
OPTION CPUSPEED (KHz) 378000
OPTION DISPLAY 70, 240
> dim integer b=rgb(black),y=rgb(yellow),c=rgb(cyan),w=rgb(white),l=rgb(blue),r=rgb(red),m=rgb(magenta)
> dim integer i,cannon(120)
> dim integer x(60)=(b,b,b,b,b,w,w,b,b,b,b,b,b,b,b,b,y,c,c,y,b,b,b,b,b,b,b,y,c,w,w,c,y,b,b,b,b,b,b,y,c,c,c,c,y,b,b,b,b,b,y,y,c,w,w,c,y,y,b,b,b)
> dim integer z(58)=(b,y,c,c,c,c,c,c,y,b,b,b,y,l,l,l,r,r,l,l,l,y,b,y,y,l,l,l,r,r,l,l,l,y,y,b,b,y,r,r,r,r,r,r,y,b,b,b,b,b,y,m,m,m,m,y,b,b,b)
> for i=0 to 60: cannon(i)=x(i): next
> for i=0 to 58: cannon(i+61)=z(i): next


It's MODE 16 that gets you 240 characters per line.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 1647
Posted: 11:00pm 02 Aug 2022
Copy link to clipboard 
Print this post

Thanks. This looks like it will work. I got to sort running it on rpi pico from mmedit.. copy to teraterm?? so much to learn.
If no multiline then
dim word sprite1(256)=(wh,bl,bl,bl,bl,bk,bk,bk,bk,bk,bk,bl,bl,bl,bl,wh}+
(bk,bl,re,re,re,bl,bl,bk,bk,bl,bl,re,re,re,bl,bk)+
etc. ??




CONST BLACK=bk
const white=wh
const blue=bl
const green=gr
const cyan=cy
const red=re
const magenta=ma
const yellow=ye
const brown=br

Start:

Randomize

dim word sprite1(256)=(wh,bl,bl,bl,bl,bk,bk,bk,bk,bk,bk,bl,bl,bl,bl,wh
bk,bl,re,re,re,bl,bl,bk,bk,bl,bl,re,re,re,bl,bk
bk,bk,bl,re,re,re,bl,bk,bk,bl,re,re,re,bl,bk,bk
bk,bk,bk,bl,re,wh,bl,bk,bk,bl,wh,re,bl,bk,bk,bk
bk,bk,bk,bk,bl,wh,bl,bk,bk,bl,wh,bl,bk,bk,bk,bk
bk,bk,bk,bk,bk,bl,bl,bk,bk,bl,bl,bk,bk,bk,bk,bk
bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk
bk,bk,bk,bk,ye,ye,ye,bk,bk,ye,ye,ye,bk,bk,bk,bk
bk,bk,bk,ye,bk,bk,bk,bk,bk,bk,bk,bk,ye,bk,bk,bk
bk,ye,ye,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,ye,ye,bk
bk,ye,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,ye,bk
ye,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bl,ye
ye,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,ye
ye,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,ye
bk,ye,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,ye,bk
bk,bk,ye,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,ye,bk,bk)
'
dim word sprite2(256)=(bl,bl,bl,bl,bl,bk,bk,bk,bk,bk,bk,bl,bl,bl,bl,bl
bk,bl,re,re,re,bl,bl,bk,bk,bl,bl,re,re,re,bl,bk
bk,bk,bl,wh,wh,re,bl,bk,bk,bl,re,wh,wh,bl,bk,bk
bk,bk,bk,bl,re,wh,bl,bk,bk,bl,wh,re,bl,bk,bk,bk
bk,bk,bk,bk,bl,wh,bl,bk,bk,bl,wh,bl,bk,bk,bk,bk
bk,bk,bk,bk,bk,bl,bl,bk,bk,bl,bl,bk,bk,bk,bk,bk
bk,bk,bk,bk,bk,bk,bk,ye,ye,bk,bk,bk,bk,bk,bk,bk
bk,bk,bk,bk,bk,ye,ye,bk,bk,ye,ye,bk,bk,bk,bk,bk
bk,bk,bk,bk,ye,ye,bk,bk,bk,bk,ye,ye,bk,bk,bk,bk
bk,bk,bk,bk,ye,bk,bk,bk,bk,bk,bk,ye,bk,bk,bk,bk
bk,bk,bk,ye,bk,bk,bk,bk,bk,bk,bk,bk,ye,bk,bk,bk
bk,bk,ye,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,ye,bk,bk
bk,bk,bk,ye,ye,bk,bk,bk,bk,bk,bk,ye,ye,bk,bk,bk
bk,bk,bk,bk,ye,ye,bk,bk,bk,bk,ye,ye,bk,bk,bk,bk
bk,bk,bk,bk,bk,ye,bk,bk,bk,bk,ye,bk,bk,bk,bk,bk
bk,bk,bk,bk,bk,bk,ye,bk,bk,ye,bk,bk,bk,bk,bk,bk)
'
dim word cannon(120)=(bk,bk,bk,bk,bk,wh,wh,bk,bk,bk,bk,bk,
bk,bk,bk,bk,ye,cy,cy,ye,bk,bk,bk,bk,
bk,bk,bk,ye,cy,wh,wh,cy,ye,bk,bk,bk,
bk,bk,bk,ye,cy,cy,cy,cy,ye,bk,bk,bk,
bk,bk,ye,ye,cy,wh,wh,cy,ye,ye,bk,bk,
bk,bk,ye,cy,cy,cy,cy,cy,cy,ye,bk,bk,
bk,ye,bl,bl,bl,re,re,bl,bl,bl,ye,bk,
ye,ye,bl,bl,bl,re,re,bl,bl,bl,ye,ye,
bk,bk,ye,re,re,re,re,re,re,ye,bk,bk,
bk,bk,bk,ye,fu,fu,fu,fu,ye,bk,bk,bk)
'
dim word missile(16)=(wh,wh
re,re
ye,ye
wh,wh
wh,wh
ye,ye
re,re
wh,wh)
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 11:20pm 02 Aug 2022
Copy link to clipboard 
Print this post

No multi-line at all. No way to do it. You simply have to work out another way to achieve what you want.

When I'm working on code and I'm not really sure of what I am doing, I rarely write more than a half-dozen lines without trying it on a real 'Mite. That's the best way to figure out what you can and can not do.

~
Edited 2022-08-03 09:22 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 01:48am 03 Aug 2022
Copy link to clipboard 
Print this post

stanleyella, Commands cannot extend over more than one line. No matter how many different ways you present it, IT WILL NOT WORK.

  Quote  You can't split MMbasic commands across lines


Can I please suggest that you get the Picomite working with MMEdit first and start with small examples as lizby suggested.

Start your program with:
OPTION BASE 0        ' 0 based arrays
OPTION DEFAULT NONE  ' Don't assume a type for variables
OPTION EXPLICIT      ' Force variables to be declared in advance with
                    ' DIM, LOCAL, CONST or STATIC

Note that OPTION BASE 0 is the default but it does clarify the situation
Also note that because there is a zero entry in the array, you don't have to use it as in Mick's example below.

Try Mick's example:
DIM INTEGER a(5), b(3), c(4)

RESTORE first
for i-1 to 5
READ a(i)
next

RESTORE third
for i=1 to 4
read c(i)
next

RESTORE second
for i=1 to 3
READ b(i)
next

first:
DATA 10,20,30,40,50

second:
DATA 100,200,300

third:
DATA 101,102,103,104


You don't have to use the RESTORE command if you are reading the data sequentially. The data pointer will stay ready to read the next piece of date so the following should also work.

DIM INTEGER a(5), b(3), c(4)

' first
for i-1 to 5
READ a(i)
next

' second
for i=1 to 3
READ b(i)
next

' third
for i=1 to 4
read c(i)
next

first:
DATA 10,20,30,40,50

second:
DATA 100,200,300

third:
DATA 101,102,103,104



Get this working and build your program up from there.

Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5907
Posted: 02:43am 03 Aug 2022
Copy link to clipboard 
Print this post

dim word missile(16)

You have just created a variable called word and an array called Missile()
Because you didn't specify a 'type' they will both be floating point. Not what you are after.

Because it's not the first time you created a variable called 'word' the interpreter will not be happy.

Read the manual about DIM

CONST BLACK=bk
const white=wh
const blue=bl
const green=gr
const cyan=cy


I think what you are trying to do is create constants for the colours.
The code to do that looks like:
CONST bk = RGB(BLack)
etc
If your colour is not one of the predefined ones, use RGB(rrr, ggg, bbb)
The predefined colours for the picomite (Not picomiteVGA) are:

WHITE       RGB(255,  255,  255)
YELLOW      RGB(255,  255,    0)
LILAC       RGB(255,  128,  255)
BROWN       RGB(255,  128,    0)
FUCHSIA     RGB(255,  64,   255)
RUST        RGB(255,  64,     0)
MAGENTA     RGB(255,  0,    255)
RED         RGB(255,  0,      0)
CYAN        RGB(0,    255,  255)
GREEN       RGB(0,    255,    0)
CERULEAN    RGB(0,    128,  255)
MIDGREEN    RGB(0,    128,    0)
COBALT      RGB(0,    64,   255)
MYRTLE      RGB(0,    64,     0)
BLUE        RGB(0,    0,    255)
BLACK       RGB(0,    0,      0)
BROWN       RGB(255,  128,    0)
GRAY        RGB(128,  128,  128)
LITEGRAY    RGB(210,  210,  210)
ORANGE      RGB(255,  165,    0)
PINK        RGB(255,  160,  171)
GOLD        RGB(255,  215,    0)
SALMON      RGB(250,  128,  114)
BEIGE       RGB(245,  245,  220)

Edited 2022-08-03 12:45 by TassyJim
VK7JH
MMedit   MMBasic Help
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5907
Posted: 03:01am 03 Aug 2022
Copy link to clipboard 
Print this post

Download this:
https://geoffg.net/Downloads/Maximite/Programming_with_the_Colour_Maximite_2.pdf
It is written for the CMM2 but most is directly compatible with the picomite.
VK7JH
MMedit   MMBasic Help
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 903
Posted: 06:02am 03 Aug 2022
Copy link to clipboard 
Print this post

how abaout a string to store the sprite data?
so you use one byte per pixel.
From the example

Dim Col%(15)
Restore colors
For f%=1 To 15:Read Col%(f%):Next f%
MODE 2
'----
CLS
For y%=0 To 15
 Read line$
 For x%=1 To Len(line$)
    Pixel x%-1,y%, Col%(Val("&H"+Mid$(line$,x%,1)))
 Next x%
Next y%

For y%=0 To 15
 Read line$
 For x%=1 To Len(line$)
    Pixel x%+15,y%,Col%(Val("&H"+Mid$(line$,x%,1)))
 Next x%
Next y%
For y%=0 To 9
 Read line$
 For x%=1 To Len(line$)
    Pixel x%+31,y%,Col%(Val("&H"+Mid$(line$,x%,1)))
 Next x%
Next y%

For y%=0 To 7
 Read line$
 For x%=1 To Len(line$)
    Pixel x%+47,y%,Col%(Val("&H"+Mid$(line$,x%,1)))
 Next x%
Next y%

' here you can read it with the BLIT/Sprite read Command
Print @(0,64);

colors:
'--Colorscheme accordung to matherp
Data RGB(BLUE),RGB(GREEN),RGB(CYAN),RGB(RED)
Data RGB(MAGENTA),RGB(YELLOW),RGB(WHITE),RGB(MYRTLE)
Data RGB(COBALT) ,RGB(MIDGREEN),RGB(CERULEAN),RGB(RUST)
Data RGB(FUCHSIA),RGB(BROWN),RGB(LILAC)

spriteData1:
Data "7111100000011117"
Data "0144411001144410"
Data "0014441001444100"
Data "0001471001741000"
Data "0000171001710000"
Data "0000011001100000"
Data "0000000000000000"
Data "0000666006660000"
Data "0006000000006000"
Data "0660000000000660"
Data "0600000000000060"
Data "6000000000000016"
Data "6000000000000006"
Data "6000000000000006"
Data "0600000000000060"
Data "0060000000000600"

spriteData2:
Data "1111100000011111"
Data "0144411001144410"
Data "0017741001477100"
Data "0001471001741000"
Data "0000171001710000"
Data "0000011001100000"
Data "0000000660000000"
Data "0000066006600000"
Data "0000660000660000"
Data "0000600000060000"
Data "0006000000006000"
Data "0060000000000600"
Data "0006600000066000"
Data "0000660000660000"
Data "0000060000600000"
Data "0000006006000000"

cannonData:
Data "000007700000"
Data "000063360000"
Data "000637736000"
Data "000633336000"
Data "006637736600"
Data "006333333600"
Data "061114411160"
Data "661114411166"
Data "006444444600"
Data "0006DDDD6000"

missileData:
Data "77"
Data "44"
Data "66"
Data "77"
Data "77"
Data "66"
Data "44"
Data "77"                            


Edited 2022-08-03 16:10 by Martin H.
'no comment
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 326
Posted: 07:35am 03 Aug 2022
Copy link to clipboard 
Print this post

  stanleyella said  So would this work? It would be ok as rpi pico has lots of ram.
dim word cannon(120)=(bk,bk,bk,bk,bk,wh,wh,bk,bk,bk,bk,bk,
bk,bk,bk,bk,ye,cy,cy,ye,bk,bk,bk,bk,
bk,bk,bk,ye,cy,wh,wh,cy,ye,bk,bk,bk,
bk,bk,bk,ye,cy,cy,cy,cy,ye,bk,bk,bk,
bk,bk,ye,ye,cy,wh,wh,cy,ye,ye,bk,bk,
bk,bk,ye,cy,cy,cy,cy,cy,cy,ye,bk,bk,
bk,ye,bl,bl,bl,re,re,bl,bl,bl,ye,bk,
ye,ye,bl,bl,bl,re,re,bl,bl,bl,ye,ye,
bk,bk,ye,re,re,re,re,re,re,ye,bk,bk,
bk,bk,bk,ye,fu,fu,fu,fu,ye,bk,bk,bk)

all help appreciated... not much on line ie examples


No, it's longer than one screen line so it won't work.
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 903
Posted: 09:23am 03 Aug 2022
Copy link to clipboard 
Print this post

but wait, there is more  
with a little "Compression" of repeating pixels
you can save some more Bytes

Dim Col%(15)
Restore colors
For f%=1 To 15:Read Col%(f%):Next f%
MODE 2
'----
CLS
For y%=0 To 15
 Read ln$:Ln$=expand$(ln$)
 For x%=1 To Len(ln$)
    Pixel x%-1,y%, Col%(Val("&H"+Mid$(ln$,x%,1)))
 Next x%
Next y%

For y%=0 To 15
 Read ln$:Ln$=expand$(ln$)
 For x%=1 To Len(ln$)
    Pixel x%+15,y%,Col%(Val("&H"+Mid$(ln$,x%,1)))
 Next x%
Next y%
For y%=0 To 9
 Read ln$:Ln$=expand$(ln$)
 For x%=1 To Len(ln$)
    Pixel x%+32,y%,Col%(Val("&H"+Mid$(ln$,x%,1)))
 Next x%
Next y%

For y%=0 To 7
 Read ln$:Ln$=expand$(ln$)
 For x%=1 To Len(ln$)
    Pixel x%+48,y%,Col%(Val("&H"+Mid$(ln$,x%,1)))
 Next x%
Next y%

' From here you can read them with the "BLIT/Sprite read" Command
Print @(0,64);

'------------------------------------
'simple Compressien of repeating Pixels:
'if a Pixel repeats more than two times, Colors replaced from
'0123456789ABCDEF
'to
'GHIJKLMNOPQRSTUV
'followed by the number (single Hex value) of repeats-1
'
'for example "GF" is a row of 16 Pixels in Black/Transparent (just 2 Bytes)
'or "T3" a row of 4 Pixels in "Fuchsia"
'
Function expand$(pxl$)
Local n%,nmb%,tmp$,co$
For n%=1 To Len(pxl$)
If Asc(Mid$(pxl$,n%,1))< 71 Then
  tmp$=tmp$+Mid$(pxl$,n%,1)
 Else
  co$=Hex$(Asc(Mid$(pxl$,n%,1))-71)
  Inc n%
  nmb%=Val("&H"+Mid$(ln$,n%,1))
  tmp$=tmp$+String$(nmb%+1,co$)
EndIf
Next n%
expand$=tmp$
End Function

colors:
'--Colorscheme accordung to matherp
Data RGB(BLUE),RGB(GREEN),RGB(CYAN),RGB(RED)
Data RGB(MAGENTA),RGB(YELLOW),RGB(WHITE),RGB(MYRTLE)
Data RGB(COBALT) ,RGB(MIDGREEN),RGB(CERULEAN),RGB(RUST)
Data RGB(FUCHSIA),RGB(BROWN),RGB(LILAC)

spriteData1:
Data "7H3G5H37"
Data "01K2110011K210"
Data "001K21001K2100"
Data "G21471001741G2"
Data "G317100171G3"
Data "G4110011G4"
Data "GF"
Data "G3M200M2G3"
Data "G26G76G2"
Data "066G9660"
Data "06GB60"
Data "6GC16"
Data "6GD6"
Data "6GD6"
Data "06GB60"
Data "006G9600"

spriteData2:
Data "H4G5H4"
Data "01K2110011K210"
Data "0017741001477100"
Data "G21471001741G2"
Data "G317100171G3"
Data "G4110011G4"
Data "G6M2G6"
Data "G4660066G4"
Data "G366G366G3"
Data "G36G56G3"
Data "G26G76G2"
Data "006G9600"
Data "G266G566G2"
Data "G366G366G3"
Data "G46G36G4"
Data "G56006G5"

cannonData:
Data "G477G4"
Data "G36336G3"
Data "G2637736G2"
Data "G26I36G2"
Data "006637736600"
Data "006I5600"
Data "06H244H260"
Data "66H244H266"
Data "006K5600"
Data "G26T36G2"

missileData:
Data "77"
Data "44"
Data "66"
Data "77"
Data "77"
Data "66"
Data "44"
Data "77"

it reads the data as usual as long as the Value is 0 to F; but but because we use a string, we can also use other values to use them as a special Character.
In the example, 0123456789ABCDEF
will get to     GHIJKLMNOPQRSTUV
to mark, that there is a compressed Block, the length -1 (as we dont have Pixels with a lenghth of 0) is the hexvalue of the next Character in the string.

Compressing the data is just a search and replace process in the Text editor
so replace
0000000000000000 with GF
000000000000000  with GE
...
000              with G2
and so on.
Edited 2022-08-03 19:26 by Martin H.
'no comment
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 10:55am 03 Aug 2022
Copy link to clipboard 
Print this post

Here's another way to do it:

dim integer i,cannon(120)
dim string ch,s="bbbbbwwbbbbbbbbbyccybbbbbbbycwwcybbbbbbyccccybbbbbyycwwcyybbbbyccccccybbbylllrrlllybyylllrrlllyybbyrrrrrrybbbbbymmmmybbb"

for i=1 to 120
 ch=mid$(s,i,1)
 select case s
   case "b": cannon(i-1)=rgb(black)
   case "y": cannon(i-1)=rgb(yellow)
   case "c": cannon(i-1)=rgb(cyan)
   case "w": cannon(i-1)=rgb(white)
   case "l": cannon(i-1)=rgb(blue)
   case "r": cannon(i-1)=rgb(red)
   case "m": cannon(i-1)=rgb(magenta)
   case "g": cannon(i-1)=rgb(green)
 end select
next i

With TeraTerm connected to your Picomite, you can select and copy that code, in TeraTerm press F10 (AUTOSAVE), paste with either Ctrl-V or maybe Alt-V, Ctrl-Z to end, then save the file.

(Note: that "DIM string ch,s=" etc. is all one line.)

Some people like MMEdit; others like to use their preferred editor, like Notepad++, and move code to the 'mite using the F10 and paste method.

~
Edited 2022-08-03 20:56 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 1647
Posted: 01:27pm 03 Aug 2022
Copy link to clipboard 
Print this post

Thank you all for advice, I have learnt a lot. I do try to sort code myself and not bother the forum but switching from one basic to another there's a learning curve.
I am only bothering with mmbasic on rpi pico RP2040 as I'm impressed with it using ili9341. Much faster than compiled 8bit pic or even lgt380 which is 32MHz (Mega328p is 16MHz) using same display.
It has inbuilt display functions like a Nextion display but cheaper and I never liked the Nextion gui.
Using sin and cos to draw dials is not fun.
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 1647
Posted: 01:57pm 03 Aug 2022
Copy link to clipboard 
Print this post

@Tassyjim-in the manual
Arrays can also be initialised when they are declared by adding an equals
symbol (=) followed by a bracketed list of values at the end of the
declaration. For example:
DIM INTEGER nbr(4) = (22, 44, 55, 66, 88)
you said-
dim word missile(16)

You have just created a variable called word and an array called Missile()
Because you didn't specify a 'type' they will both be floating point. Not what you are after.

it was
dim word missile(16)=(wh,wh
re,re
ye,ye
wh,wh
wh,wh
ye,ye
re,re
wh,wh)

but seems you can only DIM integers,strings and floats.
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 1647
Posted: 02:15pm 03 Aug 2022
Copy link to clipboard 
Print this post

Is there any difference to using RP2040 aka rpi-pico to picomite,maximite?
Am I a beta tester or is it established on rpi?
ps thanks @Jim CONST bk = RGB(BLack)
etc
Edited 2022-08-04 00:35 by stanleyella
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5732
Posted: 02:29pm 03 Aug 2022
Copy link to clipboard 
Print this post

The PicoMite doesn't have the WORD type.
INTEGER is 64-bit signed (accurate up to 19 decimal digits)
FLOAT is double precision (starts to lose accuracy after 14 decimal digits)
STRING has 256 characters unless you DIM them using LENGTH.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
pwillard
Senior Member

Joined: 07/06/2022
Location: United States
Posts: 274
Posted: 02:37pm 03 Aug 2022
Copy link to clipboard 
Print this post

PicoMite, Maximite, and PicoMiteVGA will all have some minor differences.

Some minor things you can do with a standard PICOMITE are unavailable on PicoiMiteVGA, for example, because it has some VGA-specific things it does instead. Maximite is a larger family of devices and some minor things are different (meaning you might have to tweak some code written for Maximite to get it to run on Picomite)

Are you a Beta Tester?  I would say "No".
 
     Page 2 of 16    
Print this page
© JAQ Software 2024