Ross Gardiner / Mbed 2 deprecated PiballNeoController

Dependencies:   NeoStrip SerialDriver mbed-rtos mbed

Revision:
2:868c8a43e4b7
Parent:
1:6feb61c0e4a1
Child:
3:d331c534064f
diff -r 6feb61c0e4a1 -r 868c8a43e4b7 main.cpp
--- a/main.cpp	Sat Jan 30 20:26:13 2016 +0000
+++ b/main.cpp	Sun Jan 31 01:25:59 2016 +0000
@@ -1,14 +1,23 @@
 #include "mbed.h"
 #include "SerialDriver.h"
+#include "NeoStrip.h"
+#include "gt.h"
  
+#define N 64
+
 SerialDriver rpi(p9, p10);
 SerialDriver pc(USBTX, USBRX);
 DigitalOut myled(LED1);
+NeoStrip strip(p18, N);
 
 int flash();
+void set_pattern(NeoStrip strip);
 
-int main()
-{
+int main() {
+    pc.printf("MBED: startup\n");
+    
+    pattern(strip);
+    
     // setup serial port
     rpi.baud(115200);
     
@@ -30,7 +39,7 @@
     int result = strcmp(line_buffer, "hello");
     
     if (result == 0) {
-        flash();
+        set_pattern(strip);
     } else {
         pc.printf("Did not match.\n");
         pc.printf(line_buffer);
@@ -45,4 +54,10 @@
         myled = 0;
         wait(0.2);
     }
+}
+
+void set_pattern(NeoStrip strip) {
+    strip.setBrightness(0.2);
+    strip.setPixels(0, N, gt_img);
+    strip.write();
 }
\ No newline at end of file