Arduino Pin Library  v4.2.0
An easy to use Arduino library for fast and simultaneous operations on Arduino I/O pins.
Pin-Custom.ino
Go to the documentation of this file.
1 
8 #include <Pin.h> // Include Pin Library
9 
10 Pin myPin = Pin(13, 1<<7, TIMER0A, &PINB, &PORTB, &DDRB); // Create Pin object for digital pin labelled 13 on Arduino Mega, getAnalogValue() and setDutyCycle(int value) not supported
11 
15 void setup() {
16  myPin.setOutput(); // Set Pin to output mode
17  myPin.setHigh(); // Set Pin to output high
18 }
19 
23 void loop() {
24  myPin.toggleState(); // Set Pin to output the opposite of the previous output (HIGH -> LOW, LOW -> HIGH)
25 
26  delay(200); // Wait 200 milliseconds
27 }
void setHigh()
Set the pin output to HIGH.
Definition: Pin.h:365
Class for fast operations on Arduino I/O pins.
Definition: Pin.h:39
void setOutput()
Set the pin mode to output.
Definition: Pin.h:355
Fast operations on Arduino I/O pins.
void toggleState()
Toggle the pin state (HIGH -> LOW, LOW -> HIGH)
Definition: Pin.h:431
void setup()
Called at start.
Definition: Pin-Custom.ino:15
Pin myPin
Definition: Pin-Custom.ino:10
void loop()
Called continously after setup.
Definition: Pin-Custom.ino:23