mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-22 21:23:07 +03:00
parent
3d71bec59a
commit
8559c8bbb1
@ -117,9 +117,13 @@ sample code bearing this copyright.
|
|||||||
#include "OneWire.h"
|
#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);
|
bitmask = PIN_TO_BITMASK(pin);
|
||||||
baseReg = PIN_TO_BASEREG(pin);
|
baseReg = PIN_TO_BASEREG(pin);
|
||||||
#if ONEWIRE_SEARCH
|
#if ONEWIRE_SEARCH
|
||||||
|
@ -135,7 +135,7 @@ class OneWire
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OneWire( uint8_t pin);
|
OneWire(uint8_t pin, bool pullup = true);
|
||||||
|
|
||||||
// Perform a 1-Wire reset cycle. Returns 1 if a device responds
|
// Perform a 1-Wire reset cycle. Returns 1 if a device responds
|
||||||
// with a presence pulse. Returns 0 if there is no device or the
|
// with a presence pulse. Returns 0 if there is no device or the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user