mirror of
https://github.com/mysensors/MySensors.git
synced 2026-03-11 18:47:12 +01:00
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
26 lines
664 B
C++
26 lines
664 B
C++
// Use begin to assign pin numbers.
|
|
// Read pin 12 and write the value to pin 13.
|
|
#include <DigitalIO.h>
|
|
|
|
// Declare the PinIO instances.
|
|
PinIO readPin;
|
|
PinIO writePin;
|
|
//------------------------------------------------------------------------------
|
|
void setup()
|
|
{
|
|
// Assign pin 12 to readPin.
|
|
readPin.begin(12);
|
|
|
|
// input mode with pull-ups disabled
|
|
readPin.config(INPUT, LOW);
|
|
|
|
// Assign pin 13 to writePin and set mode to output.
|
|
writePin.begin(13);
|
|
writePin.mode(OUTPUT);
|
|
}
|
|
//------------------------------------------------------------------------------
|
|
void loop()
|
|
{
|
|
// Copy the value read from readPin to writePin.
|
|
writePin.write(readPin.read());
|
|
} |