SCA61T Example

Dependencies:   mbed SCA61T

main.cpp

Committer:
Veino
Date:
2011-03-10
Revision:
1:7ec2e17b7a96
Parent:
0:da4b7bd0b350

File content as of revision 1:7ec2e17b7a96:

#include "mbed.h"
#include "SCA61T.h"

SCA61T sca61t(p11,p12,p13,p21,0);                   // MOSI, MISO, SCLK, CSB, 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.
    }
}