Arduino-GPIO
General Purpose Input/Output (GPIO) library for Arduino
ShiftInOut.ino
Go to the documentation of this file.
1 #include "GPIO.h"
2 #include "SRPIO.h"
3 #include "benchmark.h"
4 
6 
7 void setup()
8 {
9  Serial.begin(57600);
10  while (!Serial);
11  BENCHMARK_BASELINE(1000);
12 }
13 
14 void loop()
15 {
16  uint8_t value = 0;
17 
18  BENCHMARK("1. SRPIO input operator", 1000) {
19  srpio >> value;
20  }
21 
22  value = 0xa5;
23  BENCHMARK("2. SRPIO output operator", 1000) {
24  srpio << value;
25  }
26 
27  Serial.println();
28  delay(2000);
29 }
SRPIO< LSBFIRST, BOARD::D1, BOARD::D2 > srpio
Definition: ShiftInOut.ino:7
#define BENCHMARK(msg, scale)
Definition: benchmark.h:52
#define BENCHMARK_BASELINE(scale)
Definition: benchmark.h:34
Software::Serial< BOARD::D0 > Serial
Definition: ShiftInOut.ino:6
Definition: SRPIO.h:31
void loop()
Definition: ShiftInOut.ino:16
void setup()
Definition: ShiftInOut.ino:9