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

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
bgrissom
Date:
Thu Jul 03 19:55:29 2014 +0000
Child:
1:256d7a2f8391
Commit message:
This does not yet compile or run. Incremental checkin to save my progress and share with Evan.

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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jul 03 19:55:29 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file