Files
MySensors/drivers/AVR/DigitalIO/examples/PinIOReadWrite/PinIOReadWrite.ino
Patrick Fallberg 8e1ef13804 Repo restyled using astyle (#683)
The rules are in .tools/astyle/config/style.cfg
and can also be reviewed at
https://www.mysensors.org/view/260#coding-guidelines-core-library
2016-12-07 23:44:29 +01:00

18 lines
289 B
C++

// Read pin 12 and write the value to pin 13.
#include <DigitalIO.h>
PinIO readPin(12);
PinIO writePin(13);
void setup()
{
// Set input mode and disable pull-up.
readPin.config(INPUT, LOW);
// set output mode
writePin.mode(OUTPUT);
}
void loop()
{
writePin.write(readPin.read());
}