bla blal

Dependencies:   FastPWM NeoStrip mbed

Files at this revision

API Documentation at this revision

Comitter:
arno3456
Date:
Thu Jan 28 12:39:13 2016 +0000
Commit message:
initial

Changed in this revision

FastPWM.lib Show annotated file Show diff for this revision Revisions of this file
NeoStrip.lib Show annotated file Show diff for this revision Revisions of this file
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/FastPWM.lib	Thu Jan 28 12:39:13 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Sissors/code/FastPWM/#8b1bf34c72aa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NeoStrip.lib	Thu Jan 28 12:39:13 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/arno3456/code/NeoStrip/#396182c9d326
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jan 28 12:39:13 2016 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+#include "NeoStrip.h"
+
+int N=2268; //number of leds
+
+Serial pc(USBTX, USBRX);
+NeoStrip strip(p22, N);
+extern "C" void mbed_reset();
+
+float bright = 1.0;
+
+/*bool equal(float a, float b) {
+    if (abs(a - b) < 0.00001)
+        return true;
+    else
+        return false;
+}*/
+
+void SetAll()
+{
+    for (int i=0; i<N; i++) {
+        strip.setPixel(i,255,255,255);
+    }
+    strip.write();
+}
+
+int main(int argc, char** argv) {
+    pc.baud(115200);
+    
+    SetAll(1.0f);
+    
+    printf("Welcome!\n");
+    
+    while(1) {
+        wait(0.5);
+        
+        //SetAll(1.0f);
+        
+        if (pc.readable()) {
+            switch(pc.getc()) {
+                case 'r':
+                    printf("Resetting");
+                    mbed_reset();
+                    break;
+                case 'b': {
+                    bright += 0.1;
+                    if (bright>1.01) bright=0;   // set default brightness
+                    strip.setBrightness(bright);
+                    SetAll(1.0f);
+                    printf("brightness: %.2f\r\n",bright);  
+                }
+                break;
+            }    
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jan 28 12:39:13 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6f327212ef96
\ No newline at end of file