Drivers for temperature and humidity sensor SHF15. Modified for EDE_PRO2_team1
Fork of PRO2_SHT15_Example by
Diff: main.cpp
- Revision:
- 1:4c7450d9de9d
- Parent:
- 0:f850dfb07e93
- Child:
- 2:4fba73b78e1c
diff -r f850dfb07e93 -r 4c7450d9de9d main.cpp --- a/main.cpp Fri Nov 19 16:51:29 2010 +0000 +++ b/main.cpp Mon May 08 12:13:13 2017 +0000 @@ -1,28 +1,6 @@ /** * Copyright (c) 2010 Roy van Dam <roy@negative-black.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ +**/ #include "mbed.h" #include "SHTx/sht15.hpp" @@ -30,9 +8,9 @@ Serial pc(USBTX, USBRX); DigitalOut busy(LED1); -// I used p9 and p10 here but you -// can use any other GPIO as well. -SHTx::SHT15 sensor(p9, p10); +//ports on the Nucleo: +SHTx::SHT15 sensor(PB_8, PB_9); + int main() { @@ -47,14 +25,10 @@ // Temperature in celcius sensor.setScale(false); - pc.printf("Temperature [ %3.2f C ]\r\n", sensor.getTemperature()); - - // Temperature in fahrenheit - sensor.setScale(true); - pc.printf(" [ %3.2f F ]\r\n", sensor.getTemperature()); + pc.printf("Temperature [ %3.2f C ]\r\n", sensor.getTemperature()); //SKAL RETTES // Relative Humidity - pc.printf("Humdity [ %3.2f %% ]\r\n\n", sensor.getHumidity()); + pc.printf("Humdity [ %3.2f %% ]\r\n\n", sensor.getHumidity()); //SKAL RETTES wait(5); }