Fork of DS1820 that can function with the data and parasite power pin being the same.

Dependents:   AutonomousDAQ AutonomousDAQ

Fork of DS1820 by David Pairman

Files at this revision

API Documentation at this revision

Comitter:
uci1
Date:
Thu Nov 30 05:57:26 2017 +0000
Parent:
7:aceafdd78b28
Commit message:
explicitly set data pin high instead of input() which requires a pull-up resistor

Changed in this revision

DS1820.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/DS1820.cpp	Thu Oct 30 05:55:15 2014 +0000
+++ b/DS1820.cpp	Thu Nov 30 05:57:26 2017 +0000
@@ -46,11 +46,11 @@
     _datapin = 0;
     wait_us(3);                 // DXP modified from 5
     if (bit_data) {
-        _datapin.input(); // bring data line high
+         _datapin = 1; // bring data line high
         wait_us(55);
     } else {
         wait_us(55);            // keep data line low
-        _datapin.input();
+        _datapin = 1;
         wait_us(10);            // DXP added to allow bus to float high before next bit_out
     }
 }