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 
5 #include "Software/Serial.h"
8 #define DATA_PIN 0
9 #define CLOCK_PIN 1
10 
11 void setup()
12 {
13  Serial.begin(57600);
14  while (!Serial);
15  BENCHMARK_BASELINE(1000);
16  pinMode(DATA_PIN, OUTPUT);
17  pinMode(CLOCK_PIN, OUTPUT);
18 }
19 
20 void loop()
21 {
22  uint8_t value = 0xa5;
23 
24  BENCHMARK("1. Arduino core shiftOut", 1000) {
25  shiftOut(DATA_PIN, CLOCK_PIN, LSBFIRST, value);
26  }
27 
28  BENCHMARK("2. SRPO output operator", 1000) {
29  srpo << value;
30  }
31 
32  Serial.println();
33  delay(2000);
34 }
SRPO< LSBFIRST, BOARD::D1, BOARD::D2 > srpo
Definition: ShiftOut.ino:7
void begin(uint32_t baudrate)
Definition: Serial.h:50
#define CLOCK_PIN
Definition: ShiftOut.ino:9
Software::Serial< BOARD::D0 > Serial
Definition: ShiftOut.ino:6
#define DATA_PIN
Definition: ShiftOut.ino:8
Definition: SRPO.h:31
#define BENCHMARK(msg, scale)
Definition: benchmark.h:52
#define BENCHMARK_BASELINE(scale)
Definition: benchmark.h:34
void loop()
Definition: ShiftOut.ino:20
void setup()
Definition: ShiftOut.ino:11