Arduino Pin Library  v4.2.0
An easy to use Arduino library for fast and simultaneous operations on Arduino I/O pins.
Pin-Analog.ino
Go to the documentation of this file.
1 
8 #include <Pin.h> // Include Pin Library
9 
10 Pin myPin0 = Pin(A0); // Create Pin object for analog pin labelled A0 on any of the supported boards
11 Pin myPin1 = Pin(17); // Create Pin object for analog pin labelled A3 on the Arduino Uno (Pin(17) = Pin(A3) for the Arduino Uno)
12 
16 void setup() {
17  Serial.begin(9600); // Start serial communication at 9600 baud
18 
19  myPin0.setInput(); // Set Pin to input mode
20  myPin1.setInput(); // Set Pin to input mode
21 }
22 
26 void loop() {
27 
28  // Read the analog value of the Pins
29  Serial.println("A0 value: " + String(myPin0.getAnalogValue()));
30  Serial.println("17 value: " + String(myPin1.getAnalogValue()));
31 
32  delay(500); // Wait 500 milliseconds
33 }
Class for fast operations on Arduino I/O pins.
Definition: Pin.h:39
uint16_t getAnalogValue()
Get the analog value of the pin.
Definition: Pin.h:233
void setup()
Called at start.
Definition: Pin-Analog.ino:16
Fast operations on Arduino I/O pins.
void loop()
Called continously after setup.
Definition: Pin-Analog.ino:26
void setInput()
Set the pin mode to input.
Definition: Pin.h:301
Pin myPin1
Definition: Pin-Analog.ino:11
Pin myPin0
Definition: Pin-Analog.ino:10