// polygon(x,y,r,num,deg,color) function polygon(x,y,r,num,deg,c){ var ox=x+sin8(deg+90)*r>>8; var oy=y+sin8(deg)*r>>8; var d=360/num,n=0; while(n<=num){ var ax=x+sin8(deg+90)*r>>8; var ay=y+sin8(deg)*r>>8; uart(128,8,1,ox,oy,ax,ay,c); ox=ax;oy=ay; n=n+1; deg=deg+d; } } // Sample Code uart("\nPC CLEAR 00\n"); polygon(40,22,20,6,30,2);