PIO IX 6° A TP1_ejercicio1 ALMADA, Santiago MAVER, Francisco
Dependencies: mbed tsi_sensor DS1820
main.cpp
- Committer:
- Franmaver
- Date:
- 2019-05-22
- Revision:
- 5:ea823404aea8
- Parent:
- 3:f483abe4bc57
- Child:
- 6:3ebdc74fd68f
File content as of revision 5:ea823404aea8:
#include "mbed.h" #include "DS1820.h" #include "tsi_sensor.h" DS1820 probe(PTB0); /* This defines will be replaced by PinNames soon */ #if defined (TARGET_KL25Z) || defined (TARGET_KL46Z) #define ELEC0 9 #define ELEC1 10 #elif defined (TARGET_KL05Z) #define ELEC0 9 #define ELEC1 8 #else #error TARGET NOT DEFINED #endif PwmOut salida1(LED_RED); TSIAnalogSlider tsi(ELEC0, ELEC1, 40); DigitalOut verde(LED_GREEN); DigitalOut azul(LED_BLUE); int main() { while(1) { probe.convertTemperature(true, DS1820::all_devices); //Start temperature conversion, wait until ready printf("It is %3.1foC\r\n", probe.temperature()); wait(1); } } //#endif