Test application for getting the Nucleo F0 30 board to work with Evan's prototype LED board.

Dependencies:   mbed

Revision:
0:b0f98b83cb07
Child:
1:256d7a2f8391
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jul 03 19:55:29 2014 +0000
@@ -0,0 +1,46 @@
+#include "mbed.h"
+
+
+/////////////////////////////////////////////////
+//              SPI SETUP
+/////////////////////////////////////////////////
+// We are not using MISO, this is a one-way bus
+SPI device(SPI_MOSI, NC, SPI_SCK);
+
+// Note: Polarity and phase are both 0 for the TC62D723FNG
+// For a graphical reminder on polarity and phase, visit:
+//     http://www.eetimes.com/document.asp?doc_id=1272534
+//
+device.format(16, 0);
+device.frequency(1000000); // 1 MHz
+/////////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////////
+//               PWMCLK
+/////////////////////////////////////////////////
+PwmOut pinPWMCLK(D9); // For Nucleo board, not for Redgarden board
+pinPWMCLK.write(0.5f); // Set to 50% duty cycle for testing
+
+
+/////////////////////////////////////////////////
+//              OTHER / DEBUG
+/////////////////////////////////////////////////
+Serial pc(SERIAL_TX, SERIAL_RX);
+DigitalOut myled(LED1);
+/////////////////////////////////////////////////
+ 
+ 
+int main() {
+    int i = 0;
+    pc.printf("Hello World!\n");
+    while(1) {
+        wait(1);
+        pc.printf("Alive for %d seconds.\n", i++);
+        myled = !myled;
+               
+        device.write(0x55);
+        device.write(0xE0);
+    }
+}
\ No newline at end of file