Mpression Uzuki sensor shield test program

Dependencies:   ADXL345_I2C Si114x Si7020 mbed

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Wed Mar 02 15:49:04 2016 +0000
Commit message:
Initial commit

Changed in this revision

ADXL345_I2C.lib Show annotated file Show diff for this revision Revisions of this file
Si114x.lib Show annotated file Show diff for this revision Revisions of this file
Si7020.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.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r eaa7a09b51b3 ADXL345_I2C.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ADXL345_I2C.lib	Wed Mar 02 15:49:04 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/nimbusgb/code/ADXL345_I2C/#92fa975dab32
diff -r 000000000000 -r eaa7a09b51b3 Si114x.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Si114x.lib	Wed Mar 02 15:49:04 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/Sissors/code/Si114x/#971d705818e7
diff -r 000000000000 -r eaa7a09b51b3 Si7020.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Si7020.lib	Wed Mar 02 15:49:04 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/kgills/code/Si7020/#eca9d19c17ab
diff -r 000000000000 -r eaa7a09b51b3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 02 15:49:04 2016 +0000
@@ -0,0 +1,66 @@
+/* Mpression Uzuki sensor shield test program
+ * Copyright (c) 2016 ARM Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ *  Mpression Uzuki sensor shield test program
+ *
+ *  @author  Toyomasa Watarai
+ *  @version 1.0
+ *  @date    3-March-2016
+ *
+ *  http://www.m-pression.com/ja/solutions/boards/uzuki-shield?p_auth=P2omuceK&p_p_id=82&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&_82_struts_action=%2Flanguage%2Fview&languageId=en_US
+ *
+ *  ADXL345 : Accelerometer
+ *  Si7013  : Temperature & Humidity Sensor
+ *  Si1145  : Proximity, Luminescence & UV Level Sensor
+ *
+ */
+
+#include "mbed.h"
+#include "ADXL345_I2C.h"
+#include "Si7020.h"
+#include "Si114x.h"
+
+Serial pc(USBTX, USBRX);
+ADXL345_I2C adxl345(A4, A5);
+Si7020 si7013(A4, A5);
+Si114x si1145(A4, A5);
+
+int main() {
+    int buf[3];
+    float humid, temp;
+    float uv;
+
+    adxl345.setPowerControl(0x00);
+    adxl345.setDataFormatControl(0x0B);
+    adxl345.setDataRate(ADXL345_3200HZ);
+    adxl345.setPowerControl(0x08);
+    
+    while(si1145.verifyConnection() != 1);
+    
+    while(1) {
+        adxl345.getOutput(buf);
+        pc.printf("ax: %-5d, ay: %-5d, az: %-5d\n", (int16_t)buf[0], (int16_t)buf[1], (int16_t)buf[2]);
+
+        si7013.getHumidity(&humid);
+        si7013.getTemperature(&temp);
+        pc.printf("Humidity: %6.2f%%, Temperature: %6.2fC\n", humid, temp);
+        
+        uv = (float)si1145.getUVIndex()/100;
+        pc.printf("Vis: %d, IR: %d, UV: %6.3f\n", si1145.getVisibleLight(), si1145.getIRLight(), uv);
+        
+        pc.printf("\n");
+        wait(1);
+    }
+}
diff -r 000000000000 -r eaa7a09b51b3 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 02 15:49:04 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb
\ No newline at end of file