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.
Revision 0:8eb6d01eab13, committed 2014-11-28
- Comitter:
- 4180_1
- Date:
- Fri Nov 28 17:57:11 2014 +0000
- Commit message:
- ver 1.0
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Nov 28 17:57:11 2014 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+//LED fire lighting effect
+PwmOut myled(LED1);
+//Use PWM output to enable LED dimming
+
+//Use Cs random number generator rand(), but scaled and
+//converted to a float (range 0.0 to 1.0) for PWM output
+inline float random_number()
+{
+ return (rand()/(float(RAND_MAX)));
+}
+
+int main()
+{
+ while(1) {
+//get a new random number for PWM
+ myled = random_number();
+//a bit slower time delay can be used for fire
+ wait(0.04);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Nov 28 17:57:11 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89 \ No newline at end of file