Skip to content

Commit

Permalink
Add begin(pin) function
Browse files Browse the repository at this point in the history
fixes #22
  • Loading branch information
PaulStoffregen committed Mar 15, 2018
1 parent 62ecd05 commit 6ad660a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion OneWire.cpp
Expand Up @@ -144,7 +144,7 @@ sample code bearing this copyright.
#include "util/OneWire_direct_gpio.h"


OneWire::OneWire(uint8_t pin)
void OneWire::begin(uint8_t pin)
{
pinMode(pin, INPUT);
bitmask = PIN_TO_BITMASK(pin);
Expand Down
3 changes: 2 additions & 1 deletion OneWire.h
Expand Up @@ -69,7 +69,8 @@ class OneWire
#endif

public:
OneWire( uint8_t pin);
OneWire(uint8_t pin) { begin(pin); }
void begin(uint8_t pin);

// 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
Expand Down

0 comments on commit 6ad660a

Please sign in to comment.