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 
5 #include "Software/Serial.h"
8 
9 void setup()
10 {
11  Serial.begin(57600);
12  while (!Serial);
13  BENCHMARK_BASELINE(1000);
14 }
15 
16 void loop()
17 {
18  uint8_t value = 0;
19 
20  BENCHMARK("1. SRPIO input operator", 1000) {
21  srpio >> value;
22  }
23 
24  value = 0xa5;
25  BENCHMARK("2. SRPIO output operator", 1000) {
26  srpio << value;
27  }
28 
29  Serial.println();
30  delay(2000);
31 }
void begin(uint32_t baudrate)
Definition: Serial.h:50
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