1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-16 11:21:18 +03:00

add pull up option to OneWire

see #447
This commit is contained in:
Markus Sattler
2015-06-21 22:19:23 +02:00
parent ccc98e6168
commit 44a96b253c
2 changed files with 7 additions and 3 deletions

View File

@ -117,9 +117,13 @@ sample code bearing this copyright.
#include "OneWire.h"
OneWire::OneWire(uint8_t pin)
OneWire::OneWire(uint8_t pin, bool pullup)
{
pinMode(pin, INPUT_PULLUP);
if(pullup) {
pinMode(pin, INPUT_PULLUP);
} else {
pinMode(pin, INPUT);
}
bitmask = PIN_TO_BITMASK(pin);
baseReg = PIN_TO_BASEREG(pin);
#if ONEWIRE_SEARCH