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