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: 4DGL-uLCD-SE PinDetect mbed
Star.cpp
00001 #include "Star.h" 00002 00003 Star::Star( uLCD_4DGL *uLCD) { 00004 _x = (int)(((float) rand() / (RAND_MAX))*127); 00005 _y = 0; 00006 _dy = 10; 00007 _uLCDptr = uLCD; 00008 } 00009 00010 void Star::update() { 00011 _y += _dy; 00012 _uLCDptr->pixel(_x, _y, 0xFFFFFF); 00013 } 00014 00015 int Star::offScreen() { 00016 if(_y + _dy >= 127) { 00017 return 1; 00018 } 00019 else { 00020 return 0; 00021 } 00022 }
Generated on Sun Jul 17 2022 07:39:56 by
1.7.2