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: NeoStrip SerialDriver mbed-rtos mbed
Diff: main.cpp
- 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