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.
Dependencies: RangeFinder mbed
Revision 1:269a3d942995, committed 2012-10-18
- Comitter:
- ryought
- Date:
- Thu Oct 18 15:46:15 2012 +0000
- Parent:
- 0:8dccbeedd000
- Commit message:
- Second
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Oct 18 15:41:43 2012 +0000
+++ b/main.cpp Thu Oct 18 15:46:15 2012 +0000
@@ -48,17 +48,13 @@
lcd.printf("%f cm", d*100);
wait(0.5);
*/
- for(circle_deg=0; circle_deg <= d*720; circle_deg++) {
- circle_rad = circle_deg * PI / 180;
- x = 65 + cos(circle_rad)*60;
- y = 65 - sin(circle_rad)*60;
- lcd.pixel(x, y, 0x00FFFF);
- }
- for(circle_deg=0; circle_deg <= d*720; circle_deg++) {
- circle_rad = circle_deg * PI / 180;
- x = 65 + cos(circle_rad)*55;
- y = 65 - sin(circle_rad)*55;
- lcd.pixel(x, y, 0x00FFFF);
+ for(int width=55; width < 61; width = width + 2
+ for(circle_deg=0; circle_deg <= d*720; circle_deg++) {
+ circle_rad = circle_deg * PI / 180;
+ x = 65 + cos(circle_rad)*width;
+ y = 65 - sin(circle_rad)*width;
+ lcd.pixel(x, y, 0x00FFFF);
+ }
}
lcd.locate(2, 7);
lcd.printf("%f m", d);