
Demo for reading DS1820 temperature sensor with STM32F103C8T6 board.
Reading DS1820 temperature sensor with STM32F103C8T6 board
Import the program into your online compiler.
Schematic
Wiring
STM32F103C8T6 | DS1820 | |||
---|---|---|---|---|
GND | <=> | GND | ||
PA_9 | <=> | DQ | ||
3.3V | <=> | VDD |
Revision 3:99631e445ec4, committed 2019-02-05
- Comitter:
- hudakz
- Date:
- Tue Feb 05 13:10:49 2019 +0000
- Parent:
- 2:171926fbefb3
- Commit message:
- Updated.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 171926fbefb3 -r 99631e445ec4 main.cpp --- a/main.cpp Tue Feb 05 12:56:14 2019 +0000 +++ b/main.cpp Tue Feb 05 13:10:49 2019 +0000 @@ -9,13 +9,13 @@ #include "DS1820.h" Serial pc(PA_2, PA_3); -DigitalOut led(LED1); +DigitalOut led(PC_13); DS1820 ds1820(PA_9); // substitute PA_9 with actual mbed pin name connected to the DS1820 data pin float temp = 0; int main() { - int error = 0; + int error = 0; if(ds1820.begin()) { while(1) {