Skip to content

Instantly share code, notes, and snippets.

@amcjen
Last active August 29, 2015 14:02
Show Gist options
  • Save amcjen/e20ef07319ed88edb7ea to your computer and use it in GitHub Desktop.
Save amcjen/e20ef07319ed88edb7ea to your computer and use it in GitHub Desktop.
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