Buy the components
d-flipflop.ino
int clockPin = 8; int dPin = 7; int ledPin = 13; void setup() { pinMode(clockPin, OUTPUT); pinMode(dPin, OUTPUT); pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(dPin, HIGH); delay(1000); digitalWrite(clockPin, LOW); delay(1000); digitalWrite(clockPin, HIGH); digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(dPin, LOW); delay(1000); digitalWrite(clockPin, LOW); delay(1000); digitalWrite(clockPin, HIGH); digitalWrite(ledPin, LOW); delay(1000); }
BOARD?=arduino:avr:uno PORT?=/dev/cu.usbmodem14* BUILD=build # Arduino CLI version 0.14.0 is used. .PHONY: default lint all flash clean default: lint all flash clean lint: cpplint --extensions=ino --filter=-legal/copyright *.ino all: arduino-cli compile --fqbn $(BOARD) --output-dir $(BUILD) ./ flash: arduino-cli upload --fqbn $(BOARD) --port $(PORT) --input-dir $(BUILD) clean: rm -r build
Wire up the hardware accordingly
Test chip SN74HC174 Hex D-Type Flip-Flop with Arduino code.
SN74HC174