reads the sensor data

Dependencies:   MAG3110 MMA8451Q SLCD TSI mbed-src

Fork of KL46Z by JP PANG

Files at this revision

API Documentation at this revision

Comitter:
jppang
Date:
Sun Feb 09 12:29:43 2014 +0000
Parent:
3:96fe777bad5a
Child:
5:a2c3562689b1
Commit message:
delete vfnLCD lib

Changed in this revision

FRDM_KL46Z_LCD.lib Show diff for this revision Revisions of this file
SLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-src.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show diff for this revision Revisions of this file
--- a/FRDM_KL46Z_LCD.lib	Fri Feb 07 14:24:49 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/highroads/code/FRDM_KL46Z_LCD/#c5fea5b6b339
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SLCD.lib	Sun Feb 09 12:29:43 2014 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/Sissors/code/SLCD/#f70873bc6121
--- a/main.cpp	Fri Feb 07 14:24:49 2014 +0000
+++ b/main.cpp	Sun Feb 09 12:29:43 2014 +0000
@@ -2,7 +2,6 @@
 #include "TSISensor.h"
 #include "MMA8451Q.h"
 #include "MAG3110.h"
-#include "vfnLCD.h"
 #include <cstdlib>
 #include <iostream>
 
@@ -11,31 +10,28 @@
 TSISensor tsi;
 MMA8451Q acc(PTE25, PTE24, 0x1D<<1);
 MAG3110 mag(PTE25, PTE24, 0x0E<<1);
-vfnLCD lcd;
 
 PwmOut rled(PTE29);
 PwmOut gled(PTD5);
 AnalogIn lightSensor(PTE22);
-DigitalIn s1(PTC3);
-DigitalIn s3(PTC12);
+InterruptIn s1(PTC3);
+InterruptIn s3(PTC12);
 
 
 int main()
 {
     using namespace std;
 
-  //  float onTime = 1.0;
+    float onTime = 1.0;
  //   float offTime = 0.0;
     float holdTime = 1.0;
-    int magX = 0, magY = 0, magZ = 0;
-   
+    int magX = 0, magY = 0, magZ = 0;   
 
     while(1) {
 
-        rled = abs(acc.getAccX());
-        //gled = abs(acc.getAccY());
+        rled = onTime - abs(acc.getAccX());
+        gled = onTime - abs(acc.getAccY());
         mag.getValues(&magX, &magY, &magZ);
-        lcd.vfnLCD_All_Segments_ON();
 
         cout << "MMA8451: " << acc.getAccX() << "\t" << acc.getAccY() << "\t" << acc.getAccZ() << "\n\r" << endl;
         cout << "MAG3110: " << magX << "\t" << magY << "\t" << magZ << "\n\r" << endl;
@@ -44,7 +40,6 @@
 
         rled = tsi.readPercentage();
         gled = tsi.readPercentage();
-        lcd.vfnLCD_All_Segments_OFF();
 
         cout << "Touch: " << tsi.readPercentage() << "\n\r" << endl;
         cout << "SW1: " << s1 << "\n\r" << endl;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-src.lib	Sun Feb 09 12:29:43 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-src/#085cde657901
--- a/mbed.bld	Fri Feb 07 14:24:49 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43
\ No newline at end of file