Skip to content
/ MKPin Public

Better control over pin position Speed ​​up using manually defined register addresses

License

Notifications You must be signed in to change notification settings

a3510377/MKPin

Repository files navigation

MKPin

Usage

Import MKPin Library

#include <MKPin.h>

Create Pin

Pin pin = Pin(13)
Pin pin[] = {12,13}

set Pin Mode

pin.setInput();
pin.setOutput();
pin.setInputPullup();
pin.setInputPulldown();

pin.getMode(); // returns the pin mode (INPUT, OUTPUT, INPUT_PULLUP)
pin.setMode(<mode>); // sets the pin mode (INPUT, OUTPUT, INPUT_PULLUP)

IO

// > digitalWrite(<pin>, LOW);
// - pin = LOW;
// - pin.setState(LOW);
pin.setLow();

// > digitalWrite(<pin>, HIGH);
// - pin = HIGH;
// - pin.setState(HIGH);
pin.setHigh();

// - pin.toggle();
pin.toggleState();
// - pin.toggleState();
pin.toggle();

// > digitalWrite(<pin>, <value>);
// - pin = <value>;
// - pin.setState(<value>);
// - pin.value(<value>);
pin.setState(<value>);

// > digitalRead(<pin>)
// - pin.value();
pin.getState();
// > digitalRead(<pin>)
// - pin.getState();
pin.value();
// > digitalWrite(<pin>, <value>)
// - pin.setState(<value>);
pin.value(<value>);

// > analogRead(<pin>)
pin.getAnalog();
// > analogWrite(<pin>, <value>)
pin.setAnalog(<value>);

// > null
// - get pin output state
pin.getOutputState();

pin getModeReg getInputReg getOutputReg

About

Better control over pin position Speed ​​up using manually defined register addresses

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages