Skip to content
This repository was archived by the owner on Jan 3, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/RemoteWiring/RemoteDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ RemoteDevice::digitalRead(
}

//we want to verify that the pin is in INPUT mode, but OUTPUT will technically work as well (mimic Arduino behavior here)
if( _pin_mode[pin_] != static_cast<uint8_t>( PinMode::INPUT ) && _pin_mode[pin_] != static_cast<uint8_t>( PinMode::OUTPUT ) )
if( _pin_mode[pin_] != static_cast<uint8_t>( PinMode::INPUT ) && _pin_mode[pin_] != static_cast<uint8_t>( PinMode::OUTPUT ) && _pin_mode[pin_] != static_cast<uint8_t>( PinMode::PULLUP ))
{
//incorrect pin mode
return PinState::LOW;
Expand Down Expand Up @@ -287,7 +287,7 @@ RemoteDevice::pinMode(
_firmata->write( static_cast<uint8_t>( mode_ ) );

//lets subscribe to this port if we're setting it to input
if( mode_ == PinMode::INPUT )
if( mode_ == PinMode::INPUT || mode_ == PinMode::PULLUP )
{
_subscribed_ports[port] |= port_mask;
_firmata->write( static_cast<uint8_t>( Firmata::Command::REPORT_DIGITAL_PIN ) | ( port & 0x0F ) );
Expand Down