Arduino Pin Library v4.2.2
An easy to use Arduino library for fast and simultaneous operations on Arduino I/O pins.
Loading...
Searching...
No Matches
Pin-Analog.ino
#include <Pin.h> // Include Pin Library
Pin myPin0 = Pin(A0); // Create Pin object for analog pin labelled A0 on any of the supported boards
Pin myPin1 = Pin(17); // Create Pin object for analog pin labelled A3 on the Arduino Uno (Pin(17) = Pin(A3) for the Arduino Uno)
void setup() {
Serial.begin(9600); // Start serial communication at 9600 baud
myPin0.setInput(); // Set Pin to input mode
myPin1.setInput(); // Set Pin to input mode
}
void loop() {
// Read the analog value of the Pins
Serial.println("A0 value: " + String(myPin0.getAnalogValue()));
Serial.println("17 value: " + String(myPin1.getAnalogValue()));
delay(500); // Wait 500 milliseconds
}
Fast operations on Arduino I/O pins.
Class for fast operations on Arduino I/O pins.
Definition Pin.h:40
void setInput()
Set the pin mode to input.
Definition Pin.h:287
uint16_t getAnalogValue()
Get the analog value of the pin.
Definition Pin.h:226