Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:14 23 Nov 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 : PicoMiteVGA DEMO

     Page 4 of 5    
Author Message
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2112
Posted: 06:54pm 10 Oct 2024
Copy link to clipboard 
Print this post

remember etch a sketch? https://www.ebay.co.uk/itm/286063259141
I had one as a kid, it was crap
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6772
Posted: 09:11pm 10 Oct 2024
Copy link to clipboard 
Print this post

They are more fun when you attach stepper motors to the knobs. :)
Mick

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

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 203
Posted: 04:52am 11 Oct 2024
Copy link to clipboard 
Print this post

Spirograph in monochrome & colour mode (1,2)
under .MOD music for your meditations :))


SPIROGRAPH.zip
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 07:53am 11 Oct 2024
Copy link to clipboard 
Print this post

La Linea

CLS
Restore lalinea
n=1
Read x1,y1
Do
Read x2,y2:Inc n:If x2=0 Then Exit
If y2=255 Then Read x1,y1,x2,y2:Inc n,2
Line x1,y1,x2,y2:Line x1+1,y1,x2+1,y2:Line x1,y1+1,x2,y2+1
x1=x2:y1=y2
Loop
'Print n
LaLinea:
Data 1,149,46,149,1,255,90,149,112,149,112,136,111,119,110,105,106,89
Data 73,104,72,113,70,119,68,125,67,126,65,123,63,122,64,119,61,118
Data 62,113,65,106,60,106,58,102,65,102,104,78,100,73,99,70,99,65,101,61
Data 104,55,113,48,119,44,125,41,130,40,131,43,131,47,129,50,124,54,118,57
Data 125,57,122,63,121,67,121,76,124,80,127,79,130,74,131,71,132,71,134,76
Data 139,77,149,82,151,84,151,88,147,100,144,104,146,107,148,104,150,108
Data 149,110,150,108,153,109,152,112,149,115,153,121,152,124,150,123,144,117
Data 143,135,142,144,140,149,223,149

Data 0,0

'no comment
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 203
Posted: 12:48pm 11 Oct 2024
Copy link to clipboard 
Print this post

  Martin H. said  La Linea

La BuBla Owl

NX=18:NY=21
CSIZE=MM.VRes\(NY+2)
SX=(MM.HRes-CSIZE*NX)\2
SX=MM.HRes-SX-CSIZE\2
SY=(MM.VRes-CSIZE*NY)\2
SY=SY+CSIZE\2
R=CSIZE/1.3

Restore OWL
For IY=0 To NY-1
 Read D%
 For IX=0 To NX-1
   X=SX-IX*CSIZE
   Y=SY+IY*CSIZE
   If D% And 2^IX Then B=1 Else B=0
   If B Then Circle X,Y,R,,,0,1
 Next
Next
OWL:
Data &H15555,&H08282,&H11111,&H02828
Data &H11011,&H08282,&H14105,&H0A008
Data &H15551,&H0AA00,&H15501,&H0AA00
Data &H05501,&H02A80,&H01541,&H00AA0
Data &H00551,&H00228,&H00445,&H0AAA2
Data &H00001
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9101
Posted: 02:18pm 13 Oct 2024
Copy link to clipboard 
Print this post

Here is one modified from the CMM2 Welcome tape originally written by Sasquatch.
Will run as-is on RP2350 VGA or HDMI or change to mode 0 for RP2040 VGA (black and white)
The code should give you most (all?) of the tools needed to implement the other CMM2 turtle demos https://github.com/thwill1000/cmm2-welcome/tree/master/turtle




Option explicit
Option default none
Dim integer TurtlePenup=1,TurtlePenColour=MM.Info(fcolour)
Dim float TurtleDirection=0.0
Dim float TurtleX,TurtleY
MODE 3
Option angle degrees
Option console none
'
Text 0, 0, "Random Recursive Fractal Pine Tree", "", 2
Text 2, 25, "Press Q to Quit", "", 1
turtle.penup
turtle.move MM.HRes\2,400
turtle.pendown
PineTree 70,19
Do :Loop Until Inkey$="Q"
Save image "b:/pine"
'
Sub pinetree(l!,d!)
 If d!<0 Then Exit Sub
 Local a!=110+20*Rnd
 If l!>5 Then
   Turtle.pen.colour(139,69,19)
 Else
   turtle.pen.colour(0,100,0)
 EndIf
 turtle.forward l!
 pinetree l!*0.8, d!-1
 turtle.turn.right a!
 PineTree l! * 0.5, d! - 3
 turtle.turn.right 120
 PineTree l! * 0.5, d! - 3
 turtle.turn.right 240-a!
 turtle.penup
 turtle.backward l!
 turtle.pendown
End Sub
'
Sub turtle.move(x!, y!)
 If Not TurtlePenup Then Line TurtleX,TurtleY,x!,y!,1,TurtlePenColour
 TurtleX=x!
 TurtleY=y!
End Sub
'
Sub turtle.penup
 TurtlePenup=1
End Sub
'
Sub turtle.pendown
 TurtlePenup=0
End Sub
'
Sub turtle.turn.right(a!)
 Inc TurtleDirection,a!
 If TurtleDirection!>360.0 Then Inc TurtleDirection!,-360.0
End Sub
'
Sub turtle.turn.left(a!)
 Inc TurtleDirection,-a!
 If TurtleDirection!<0.0 Then Inc TurtleDirection!,360.0
End Sub
'
Sub turtle.backward(l!)
 Local x!=TurtleX-Sin(TurtleDirection!)*l!
 Local y!=TurtleY+Cos(TurtleDirection!)*l!
 If Not TurtlePenup Then Line TurtleX,TurtleY,x!,y!,1,TurtlePenColour
 TurtleX=x!
 TurtleY=y!
End Sub
'
Sub turtle.forward(l!)
 Local x!=TurtleX+Sin(TurtleDirection!)*l!
 Local y!=TurtleY-Cos(TurtleDirection!)*l!
 If Not TurtlePenup Then Line TurtleX,TurtleY,x!,y!,1,TurtlePenColour
 TurtleX=x!
 TurtleY=y!
End Sub
'
Sub turtle.pen.colour(r%,g%,b%)
 TurtlePenColour=(r%<<16) + (g%<<8) + b%
End Sub

Edited 2024-10-14 00:43 by matherp
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 203
Posted: 05:15pm 20 Oct 2024
Copy link to clipboard 
Print this post

The Black Hole Mystery

MODE 2: CLS
x0=MM.HRes/2: y0=MM.VRes/2
z =2

Do
 n=(Int(Rnd*7)+1)*7000+1000
 a=(Int(Rnd*18)+3)+10
 b=Int(Rnd*19)/10+0.1
 c=-(Int(Rnd*4)+1)*10
   For i=1 To 3
     Clr=Int(Rnd*&hFFFF00)+&hFF
     Tracery
   Next i
 Clr=0
 Tracery
Loop While Inkey$=""

Sub Tracery
x=x0: y=y0
For j=1 To n
 Pixel x+63, y+42, Clr
 u=y-Sgn(x-x0)*(Abs(b*(x-x0)-c))^1/z
 w=a-x+x0: x=u: y=w
Next j
End Sub

Edited 2024-10-21 03:16 by javavi
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 203
Posted: 09:42am 26 Oct 2024
Copy link to clipboard 
Print this post

Fractal Lace

CLS
A=1:B=-1:C=-13:K1=1.5:K2=1.5:X=0:Y=0
Do
Pixel 320+Int(K1*X*4),240+Int(K2*Y*4)
S=(X<0)-(X>=0)
TMP=Y
Y=A-X
X=TMP-S*Log(Sqr(Abs(B*X-C)))
Loop Until Inkey$<>""
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2112
Posted: 10:17pm 01 Nov 2024
Copy link to clipboard 
Print this post

no lines but if there were they would not look curved
try it, better than picture



mode 2
cls
'1
x=0:y=0
b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b2:inc x,24:b1:inc x,24:b2
inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b2
'2
inc y,24:x=0
b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b4
inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b4
'3
inc y,24:x=0
b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3
inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3
'4
inc y,24:x=0
b3:inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4
inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4
'5
inc y,24:x=0
b4:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3
inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3
'6
inc y,24:x=0
b2:inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1
inc x,24:b2:inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1
'7
inc y,24:x=0
b1:inc x,24:b2:inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2
inc x,24:b1:inc x,24:b2:inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2
'8
inc y,24:x=0
b2:inc x,24:b1:inc x,24:b2:inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b1
inc x,24:b2:inc x,24:b1:inc x,24:b2:inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b1
'9
inc y,24:x=0
b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b2
inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b4:inc x,24:b2
'10
inc y,24:x=0
b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b4
inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3:inc x,24:b4
'11
inc y,24:x=0
b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3
inc x,24:b4:inc x,24:b3:inc x,24:b1:inc x,24:b2:inc x,24:b1:inc x,24:b3:inc x,24:b4:inc x,24:b3

do:loop

sub b1:
box x,y,24,24,0,rgb(white),rgb(white)
box x+2,y+2,8,8,0,rgb(black),rgb(black)
box x+14,y+14,8,8,0,rgb(black),rgb(black)
end sub

sub b2:
box x,y,24,24,0,rgb(black),rgb(black)
box x+2,y+2,8,8,0,rgb(white),rgb(white)
box x+14,y+14,8,8,0,rgb(white),rgb(white)
end sub

sub b3:
box x,y,24,24,0,rgb(black),rgb(black)
box x+2,y+14,8,8,0,rgb(white),rgb(white)
box x+14,y+2,8,8,0,rgb(white),rgb(white)
end sub

sub b4:
box x,y,24,24,0,rgb(white),rgb(white)
box x+2,y+14,8,8,0,rgb(black),rgb(black)
box x+14,y+2,8,8,0,rgb(black),rgb(black)
end sub


Edited 2024-11-02 08:58 by stanleyella
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 203
Posted: 06:59pm 07 Nov 2024
Copy link to clipboard 
Print this post

DISCO BALL  


MODE 2
Option ANGLE DEGREES
FRAMEBUFFER CREATE
FRAMEBUFFER WRITE F
RX=MM.HRes: RY=MM.VRes: CX=RX/2: CY=RY/2
Umin=-180: Umax=180: Ustep=15
Vmin= -90: Vmax= 90: Vstep=15
SCALE=CY-CY/10

Do
 For S=0 To 12 Step 3
 CLS
   For V= Vmin To Vmax Step Vstep
   For U= Umin To Umax Step Ustep
     U=U+S
       X=Cos(U)*Cos(V)
       Y=Sin(U)*Cos(V)
       Z=Sin(V)
     U=U-S
     C=Rnd*&hFFFFFF
     Plot_XY
     If Inkey$ <> "" Then End
   Next U: Next V
   FRAMEBUFFER COPY F,N,B
 Next S
Loop While Inkey$=""

Sub Plot_XY
 X=SCALE*X: Y=SCALE*Y: Z=SCALE*Z
 Y=Y/4
 X1=X-Y+CX: Y1=Z-Y+CY
 If y<0 Then
   Circle X1,Y1,2,,,C,C
 Else
   Pixel X1,Y1
 EndIf
End Sub

Edited 2024-11-08 05:00 by javavi
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2112
Posted: 07:31pm 07 Nov 2024
Copy link to clipboard 
Print this post

neat! hdmi 2350
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 203
Posted: 01:37am 17 Nov 2024
Copy link to clipboard 
Print this post

The Mystery of the 9th Planet  


FRAMEBUFFER CREATE
FRAMEBUFFER WRITE F
CX=MM.HRes\2: CY=MM.VRes\2
A=CX*5:C=&hFFFFFF
Do
CLS
For i=7 To 31 Step 3
 For j=0 To 324 Step 9
   x=CX+A*Sin(j+i+t*i/200)\i
   y=CY+A*Cos(j+i*0.3+t/2)\i
   If j=0 Then Circle x,y,3,,,,C
   Pixel x,y
 Next
Next
t=t+.05
Circle CX,CY,9,,,,C

FRAMEBUFFER COPY F,N,B
Loop Until Inkey$ <> ""
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 203
Posted: 08:07pm 17 Nov 2024
Copy link to clipboard 
Print this post

Morph

MODE 2
Dim CM(15)=(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
Colour Map CM(),CM()

W=MM.HRes:H=MM.VRes
C=-0.77:D=0.27015
For X%=0 To W Step 1
 For Y%=0 To H Step 1
   U=3*(X%-W/2)/W
   V=2*(Y%-H/2)/H
   I%=16
   Do
     I%=I%-1
     A=U*U:B=V*V
     T=A-B+C
     V=2*U*V+D
     U=T
   Loop Until A+B>2.2 Or I%<1
   Colour CM(I%)
   Pixel X%,Y%
   Pixel W-X%,H-Y%
 Next
Next
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2112
Posted: 08:51pm 17 Nov 2024
Copy link to clipboard 
Print this post

liked 9th planet
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 203
Posted: 06:11pm 18 Nov 2024
Copy link to clipboard 
Print this post

Geometric abstractionism

MODE 2
Do :CLS
For K=1 To 200
Q=Int(Rnd*5+3):If Q=7 Then Q=30
A=Rad(360/Q):S=Sin(A):C=Cos(A)
X=Rnd*320-2:Y=Rnd*240-2
R=Rnd*(Sqr(Y+X)/20)*20+16
 For L=-R/5 To R/5
  N=(Abs(L)<R/8)*Int(Rnd*16)
  U=R+L:V=U
  X1=X+U:Y1=Y+V
   For I=1 To Q
    T=V*C-U*S:U=V*S+U*C:V=T
    X2=X+U:Y2=Y+V
    Line X1,Y1,X2,Y2,,Map(N)
    X1=X2:Y1=Y2
Next I: Next L: Next K
Pause 2000
Loop
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 08:13pm 18 Nov 2024
Copy link to clipboard 
Print this post

Such complexity with so few lines of code. Astonishing.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 357
Posted: 08:55pm 18 Nov 2024
Copy link to clipboard 
Print this post

Superb art!
Wonder if you can imagine the picture while writing the code
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2112
Posted: 10:12pm 18 Nov 2024
Copy link to clipboard 
Print this post

RUN
[7] R=Rnd*(Sqr(Y+X)/20)*20+16
Error : Negative argument
>
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 203
Posted: 12:33am 19 Nov 2024
Copy link to clipboard 
Print this post

  stanleyella said  Error : Negative argument

Thanks, fixed it!
Now this art will be with us forever! ∞ 
MODE 2
Do :CLS
 For K=1 To 200
   Q=Int(Rnd*5+3): If Q=7 Then Q=30
   A=Rad(360/Q): S=Sin(A): C=Cos(A)
   X=Rnd*MM.HRes: Y=Rnd*MM.VRes
   R=Rnd*(Sqr(Y+X)/20)*20+16
   For L=-R/5 To R/5
     N=(Abs(L)<R/8)*Int(Rnd*16)
     U=R+L: V=U
     X1=X+U: Y1=Y+V
     For I=1 To Q
       T=V*C-U*S: U=V*S+U*C: V=T
       X2=X+U: Y2=Y+V
       Line X1,Y1,X2,Y2,,Map(N)
       X1=X2: Y1=Y2
     Next I
   Next
 Next
 Pause 1000
Loop

Edited 2024-11-19 10:57 by javavi
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 07:49am 19 Nov 2024
Copy link to clipboard 
Print this post

a litle animation inspired by the planet 9 demo



Mode 2
a=100:b=3:xc=160:yc=120
For n=0 To 9:For i=n To 180 Step 10
t=(i+90)*Pi/180:x=a*Cos(t):y=b*Sin(t):cl=(y<0):ball xc+x,n*20+yc+y-112,cl
Next: For i=170+n To n Step -10
t=(i-90)*Pi/180:x=a*Cos(t):y=b*Sin(t):cl=(y<0):ball xc+x,n*20+yc+y-112,cl
Next:Next
Do
 Blit 0,0,0,200,320,20:Blit 0,20,0,0,320,220:FRAMEBUFFER wait
Loop
Sub ball bx,by,cl
For d=6 To 1Step -1
If cl Then :Color RGB(255,255-d*42,0):Else :Color RGB(0,255-d*42,255):EndIf
Circle bx+d/2,by+d/2,d,d
Next
End Sub

Edited 2024-11-19 22:03 by Martin H.
'no comment
 
     Page 4 of 5    
Print this page
© JAQ Software 2024