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: DS1820 mbed-STM32F103C8T6 mbed
Fork of stm32f103c8t6-ds18b20 by
main.cpp
00001 #include "stm32f103c8t6.h" 00002 #include "mbed.h" 00003 #include "DS1820.h" 00004 00005 #define DATA_PIN PA_8 00006 00007 int main() { 00008 DS1820 probe(DATA_PIN); 00009 00010 while(1) { 00011 printf("Initiating temperature conversion\r\n"); 00012 probe.convertTemperature(true, DS1820::this_device); //Start temperature conversion, wait until ready 00013 double temperature = probe.temperature(); 00014 int temp_integer = temperature; 00015 int temp_milli = (temperature - temp_integer) * 1000; 00016 printf("It is %d.%03dC\r\n", temp_integer, temp_milli); 00017 wait(1000); 00018 } 00019 }
Generated on Mon Jul 25 2022 03:01:05 by
1.7.2
