~

Dependencies:   4DGL-uLCD-SE SDFileSystem

Revision:
12:a2908fdf3b66
Parent:
11:eca6295235e6
Child:
13:c14dc22c38ba
--- a/main.cpp	Mon Sep 26 19:15:11 2016 +0000
+++ b/main.cpp	Mon Sep 26 20:17:45 2016 +0000
@@ -1,6 +1,6 @@
 #include "mbed.h"
 #include "uLCD_4DGL.h"
-#include "LSM9DS1.h"
+//#include "LSM9DS1.h"
 #include "math.h"
 //#include "SongPlayer.h"
 #include <fstream>
@@ -21,10 +21,10 @@
 DigitalOut led4(LED4);
 */
 
-// PART 3
+/* PART 3
 
 Serial pc(p13, p14); // TX, RX
-
+*/
 
 /* PART 8
 BusOut myleds(LED1,LED2,LED3,LED4);
@@ -59,6 +59,12 @@
 int ax, ay;
 */
 
+/* PART 6
+DigitalOut myled(LED1);
+//DigitalOut Ctrl(p25); // comment this out for digital, comment below
+PwmOut Ctrl(p25);
+*/
+
 /*PART 9, SD CARD
 SDFileSystem sd(p5, p6, p7, p8, "sd");
 */
@@ -83,13 +89,14 @@
     uint16_t sample = 0;
     */
     
-    // PART 4, BUBBLE, PART 3
+    /* PART 4, BUBBLE, PART 3
     LSM9DS1 imu(p9, p10, 0xD6, 0x3C);
     imu.begin();
     if (!imu.begin()) {
         pc.printf("Failed to communicate with imu9DS1.\n");
     }
     imu.calibrate();
+    */
     
     
     /* PART 9, SD CARD
@@ -146,7 +153,7 @@
         wait(1.0/8000.0);
         */
         
-        // PART 3
+        /* PART 3
         
         
         imu.readAccel();
@@ -157,6 +164,7 @@
         pc.printf("gyro: %d %d %d\n\r", imu.gx, imu.gy, imu.gz);
         pc.printf("accel: %d %d %d\n\r", imu.ax, imu.ay, imu.az);
         pc.printf("mag: %d %d %d\n\n\r", imu.mx, imu.my, imu.mz);
+        */
         
         /* PART 4, BUBBLE/COMPASS
         
@@ -178,7 +186,27 @@
         lcd.printf("%f",180 * theta / 3.14159);
         
         */
-    
+        
+        /* PART 6
+        
+        // using DigitalOut
+//        Ctrl = 1;
+//        myled = 1;
+//        wait(.2);
+//        Ctrl = 0;
+//        myled = 0;
+//        wait(.2);
+//        
+        // using PwmOut
+        myled = 1;
+
+        for (int i = 0; i < 5; i++) {
+            Ctrl = i*0.2f;
+            wait(.1);
+            myled = 0;
+            wait(.1);
+        }
+        */
     }
 }