Veikko Soininen
/
SCA61T_example
SCA61T Example
Diff: main.cpp
- Revision:
- 0:da4b7bd0b350
- Child:
- 1:7ec2e17b7a96
--- /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. + } +}