Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:33 12 Nov 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 : Micromite eXtreme:5.05.02, arcs& polygons

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10572
Posted: 05:18pm 15 Mar 2019
Copy link to clipboard 
Print this post

Please find attached firmware 5.05.02 for the 100/144-pin parts

2019-03-22_055748_MMX5.05.02.zip

and the 64-pin parts

2019-03-22_055835_MMX645.05.02.zip

Updated manual:

2019-03-16_082952_Micromite_eXtreme_Manual.pdf

This contains two new drawing commands.

ARC x, y, r1, [r2], rad1, rad2, colour


Draws an arc of a circle of a given colour and width between two radials (defined in degrees). Parameters for the ARC command are:
x: X coordinate of centre of arc
y: Y coordinate of centre of arc
r1: inner radius of arc
r2: outer radius of arc - can be omitted if 1 pixel wide
rad1: start radial of arc in degrees
rad2: end radial of arc in degrees
colour: Colour of arc



CLS
For i=0 To 99 Step 4
Arc 120,150,20+i,,325+2*i,5+5*i,RGB(magenta)
Next i
Arc MM.HRes\4*3,150,100,110,315,45,RGB(red)
Arc MM.HRes\4*3,150,100,110,45,315,RGB(green)



and

POLYGON xarray%(), yarray%() [, bordercolour] [, fillcolour]


Draws a outline or filled polygon defined by the x,y coordinate pairs in xarray%() and yarray%(). If fill colour is omitted then just the polygon outline is drawn. If bordercolour is omitted then it will default to the current gui foreground colour. The polygon should be closed with the first and last elements the same. The size of the array must exactly match the number of x,y coordinate pairs.

See the video of the example code running on the Armmite H7. The MMX is slower but still very usable.





option explicit
option default none
dim x%(9),xd%(9)
dim y%(9),yd%(9)
dim integer i,c,f, xp, yp
dim float s
cls
for i=0 to 9 step 2
x%(i)=-(SIN(rad(i*36))*200)
y%(i)=-(COS(rad(i*36))*200)
x%(i+1)=-(SIN(rad((i+1)*36))*76)
y%(i+1)=-(COS(rad((i+1)*36))*76)
next i
do
c=rnd()*255 + ((rnd()* 255)<<8) + ((rnd()* 255)<<16)
f=rnd()*255 + ((rnd()* 255)<<8) + ((rnd()* 255)<<16)
xp=rnd()*mm.hres
yp=rnd()*mm.vres
s=rnd()
for i=0 to 9
xd%(i)=x%(i)*s+xp
yd%(i)=y%(i)*s+yp
next i
polygon xd%(), yd%(), c, f
loop

Edited by matherp 2019-03-23
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1646
Posted: 08:22pm 22 Mar 2019
Copy link to clipboard 
Print this post

These are brilliant Peter,

I hesitate to ask - but is it possible that either or both of these drawing commands could be made into CFunctions so that they will run on other Micromites and possibly the Maximite when Geoff releases the new firmware?

Bill
Keep safe. Live long and prosper.
 
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