|
Forum Index : Microcontroller and PC projects : Micromite eXtreme:5.05.02, arcs& polygons
| Author | Message | ||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572 |
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 |
||||
| Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1646 |
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. |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |