Change 1wire pin to A8 as it's 5V tolerant

Dependencies:   DS1820 mbed-STM32F103C8T6 mbed

Fork of stm32f103c8t6-ds18b20 by Alastair D'Silva

Committer:
deece
Date:
Thu Jan 25 07:34:32 2018 +0000
Revision:
18:65d50c46da23
Parent:
16:4db317017f49
Update ds18b20

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 5:3c3ef17a17a6 1 #include "stm32f103c8t6.h"
hudakz 0:ab218237069e 2 #include "mbed.h"
deece 12:c11b1e5546b0 3 #include "DS1820.h"
deece 12:c11b1e5546b0 4
deece 16:4db317017f49 5 #define DATA_PIN PA_8
deece 12:c11b1e5546b0 6
hudakz 0:ab218237069e 7 int main() {
deece 12:c11b1e5546b0 8 DS1820 probe(DATA_PIN);
hudakz 10:4b88be251088 9
hudakz 0:ab218237069e 10 while(1) {
deece 12:c11b1e5546b0 11 printf("Initiating temperature conversion\r\n");
deece 13:c91214d92d70 12 probe.convertTemperature(true, DS1820::this_device); //Start temperature conversion, wait until ready
deece 12:c11b1e5546b0 13 double temperature = probe.temperature();
deece 12:c11b1e5546b0 14 int temp_integer = temperature;
deece 12:c11b1e5546b0 15 int temp_milli = (temperature - temp_integer) * 1000;
deece 12:c11b1e5546b0 16 printf("It is %d.%03dC\r\n", temp_integer, temp_milli);
deece 12:c11b1e5546b0 17 wait(1000);
hudakz 0:ab218237069e 18 }
hudakz 0:ab218237069e 19 }