Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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