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-PWM.ino
#include <
Pin.h
>
// Include Pin Library
Pin
myPin =
Pin
(5);
// Create Pin object for digital pin labelled 5 on any of the supported boards
void
setup() {
myPin.
setOutput
();
// Set Pin to output mode
// The Pin must support PWM
myPin.
setDutyCycle
(127);
// Set Pin duty cycle to 127 (~50%)
}
void
loop() {
}
Pin.h
Fast operations on Arduino I/O pins.
Pin
Class for fast operations on Arduino I/O pins.
Definition
Pin.h:40
Pin::setOutput
void setOutput()
Set the pin mode to output.
Definition
Pin.h:339
Pin::setDutyCycle
void setDutyCycle(int value)
Set the PWM duty cycle.
Definition
Pin.h:393
Written by Alec Fenichel
Source Code:
https://github.com/fenichelar/Pin
License:
https://github.com/fenichelar/Pin/blob/master/LICENSE.md
Latest Release:
https://github.com/fenichelar/Pin/releases/latest