From c181496bb0d48e8a8b3b481ea35d2c21c6b4cecd Mon Sep 17 00:00:00 2001 From: Patrick LeBoutillier Date: Sun, 6 Sep 2020 11:53:12 -0400 Subject: [PATCH] Create master.ino --- examples/master/master.ino | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 examples/master/master.ino diff --git a/examples/master/master.ino b/examples/master/master.ino new file mode 100644 index 0000000..08bdbca --- /dev/null +++ b/examples/master/master.ino @@ -0,0 +1,21 @@ +#include "Extension.h" + +Extension sl1(5) ; +Extension sl2(6) ; + +void setup(){ + Serial.begin(9600) ; + sl1.pinMode(2, INPUT) ; + sl2.pinMode(2, INPUT) ; +} + +void loop(){ + byte v = sl1.digitalRead(2) ; + Serial.print("Pin 2 of slave 1 is: ") ; + Serial.println(v) ; + v = sl2.digitalRead(2) ; + Serial.print("Pin 2 of slave 2 is: ") ; + Serial.println(v) ; + + // ... +}