Fork to update the library (team vs. user account)

Dependencies:   SHT3XA mbed

main.cpp

Committer:
sam_grove
Date:
2018-12-21
Revision:
1:b4e81def6f93
Parent:
0:ec66ac9ea013

File content as of revision 1:b4e81def6f93:

/*
 SHT31-ARP-B Analog Humidity & Temperature Sensor Example Code 
 ClosedCube SHT31A-PRO breakout module
 
 License: This example code is in the public domain.
 Date: 14-Sep-2015
  
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 */

#include "mbed.h"
#include "SHT3XA.h"

/*
    Hardware connections:
        VDD to 3.3V
        RH to A0
        T to A1
        GND to GND   
*/
SHT3XA sht31a(A0,A1);

Serial pc(USBTX, USBRX);
 
int main() {  
    pc.baud(115200);
    pc.printf("ClosedCube SHT31A-PRO example"); 

    while( true ) {
        pc.printf("T: %3.2fC RH: %3.2f%%\n", sht31a.readTempC(), sht31a.readRH());        
        wait(0.3f);
    }
    
}