SCA61T Example

Dependencies:   mbed SCA61T

Files at this revision

API Documentation at this revision

Comitter:
Veino
Date:
Thu Feb 24 10:51:05 2011 +0000
Child:
1:7ec2e17b7a96
Commit message:
v1.0

Changed in this revision

SCA61T.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SCA61T.lib	Thu Feb 24 10:51:05 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Veino/code/SCA61T/#663ebf72b607
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Feb 24 10:51:05 2011 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+#include "SCA61T.h"
+
+SCA61T sca61t(p11,p12,p13,p21,0);                   // MOSI, MISO, SCLK, CBS, device selection
+                                                    // 0=SCA61T-FAHH1G, 1=SCA61T-FA1H1G 
+Serial pc(USBTX, USBRX);
+
+int main(void)
+{
+    while(1)
+    {
+        pc.printf("%i [C]\r\n",sca61t.ReadTemp());  // Writes the temperature to serial port.
+        pc.printf("%.1f [deg]\r\n",sca61t.ReadX()); // Writes the angle to serial port.
+        wait(1);                                    // Waits for one second and repeats.
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Feb 24 10:51:05 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912