Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: draw.h
- Revision:
- 4:6a1fff2aa293
- Parent:
- 3:25e9386596c1
- Child:
- 5:10349dda4f42
--- a/draw.h Mon May 23 11:18:35 2016 +0000
+++ b/draw.h Tue May 31 17:15:53 2016 +0000
@@ -1,14 +1,41 @@
// lieu de vos variables
// NOM commençant par un 'a' comme atiti
int atiti = 5;
+int ar ; int ab ; int av ;
// lieu de vos fonctions ..appelées plus bas
+void circle(int px , int py , int r )
+ {
+ int rx = 0; int ry = 0 ;
+ for ( rx = r ; ry <= rx ; rx-- )
+ {
+ while((rx*rx+ry*ry)<(r*r))
+ {
+ pix ( px+rx , py+ry , ar , av , ab );
+ pix ( px+rx , py-ry , ar , av , ab );
+ pix ( px-rx , py+ry , ar , av , ab );
+ pix ( px-rx , py-ry , ar , av , ab );
+ pix ( px+ry , py+rx , ar , av , ab );
+ pix ( px-ry , py+rx , ar , av , ab );
+ pix ( px+ry , py-rx , ar , av , ab );
+ pix ( px-ry , py-rx , ar , av , ab );
+ ry++;
+ }
+ }
+
+ pix ( px , py , ar , av , ab );
+ }
+
void draw() // exemple d'une chose a faire ( pas de delai dans cette boucle)
{
pix(15+accx,15+accy,0,0,7); // pixel bleu en x = 5+4 et y = 1
+ ar = 5 ; av = 0 ; ab = 0;
+ accx = abs(accx);
+ circle ( 15 , 15 , accx );
+
}
// voici les 3 fonctions utilisables