Gerardo Carmona / Mbed 2 deprecated 16_functions2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
gcarmonar
Date:
Thu Nov 07 14:20:06 2013 +0000
Commit message:
Functions Part 2

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	Thu Nov 07 14:20:06 2013 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+
+PwmOut bled(LED1);
+PwmOut gled(LED2);
+PwmOut rled(LED3);
+
+void color(int red, int green, int blue);
+
+int main() {
+    color(20,20,255);
+    while(1) {
+        
+    }
+}
+
+void color(int red, int green, int blue){
+    float r, g, b;
+    
+    r = (float)red/255;
+    g = (float)green/255;
+    b = (float)blue/255;
+    
+    bled = 1 - b;
+    gled = 1 - g;
+    rled = 1 - r;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 07 14:20:06 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file