GD74LS195A Universal 4-Bit Shift Register

Used Products:

1. 8 Position On/Off DIP Switch
2. Arduino UNO
3. GD74LS195A

Code:

#define jPin 2 #define kPin 3 #define clkPin 7 #define sleep 500 int matrix[][2] = { {1,1}, {0,0}, {1,0}, {0,1} }; void setup() { Serial.begin(9600); pinMode(jPin, OUTPUT); pinMode(kPin, OUTPUT); pinMode(clkPin, OUTPUT); } void loop() { for (int i = 0; i < 4; i++) { digitalWrite(jPin, matrix[i][0]); digitalWrite(kPin, matrix[i][1]); digitalWrite(clkPin, 1); digitalWrite(clkPin, 0); delay(sleep); } }