arduino-pin-api

A concise api for using pin management with fast mode


Keywords
api, analog, pin, digital, arduino, cpp, extensions, pin-api
License
MIT
Install
platformio lib install 7037

Documentation

Arduino PIN API

A concise api for using pin management with fast mode

API

Pin Mode
#define LED_PIN 13

// new
pin<LED_PIN>().mode(OUTPUT);

// vs

// default
pinMode(LED_PIN, OUTPUT);
Digital write
#define LED_PIN 13

// new
pin<LED_PIN>().digital().write(255);

// vs

// default
digitalWrite(LED_PIN, 255);
Digital read
#define TARGET_PIN 13

// new
const int value = pin<TARGET_PIN>().digital().read();

// vs

// default
const int value = digitalRead(TARGET_PIN);
Analog read\write
#define TARGET_PIN 13

// new
pin<TARGET_PIN>().analog().write(LOW);
const int value = pin<TARGET_PIN>().digital().read();

// vs

// default
const int value = analogRead(TARGET_PIN);
analogWrite(TARGET_PIN, LOW);

remarks

fast-mode work only in ATmega328* chips, in future planned more goto-go-fast