Last active
August 29, 2015 14:02
-
-
Save amcjen/e20ef07319ed88edb7ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool PinoccioScout::pinWrite(uint8_t pin, uint8_t value) { | |
if (isPinReserved(pin) || !isOutputPin(pin)) { | |
return false; | |
} | |
if (Scout.isDigitalPin(pin)) { | |
if (getPinMode(pin) == PWM) { | |
analogWrite(pin, value); | |
} else { | |
digitalWrite(pin, value); | |
} | |
updateDigitalPinState(pin, value, getPinMode(pin)); | |
} | |
if (Scout.isAnalogPin(pin)) { | |
digitalWrite(pin, value); | |
updateAnalogPinState(pin, value, getPinMode(pin)); | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment