/*
The LED connected sr1:Q0 (the shift-register nearest the UNO) is to be considered as A0
Keep that in mind when hooking up your eproms.
*/
//Pin connected to ST_CP of 74HC595
int SHIFT_LATCH = 8;
//Pin connected to SH_CP of 74HC595
int SHIFT_CLK = 12;
////Pin connected to DS of 74HC595
int SHIFT_DATA = 11;
void setAddress(int address) {
digitalWrite(SHIFT_LATCH, 0);
shiftOut(SHIFT_DATA, SHIFT_CLK, MSBFIRST, (address >> 8));
shiftOut(SHIFT_DATA, SHIFT_CLK, MSBFIRST, address);
digitalWrite(SHIFT_LATCH, 1);
Serial.println(address);
}
void setup() {
pinMode(SHIFT_DATA, OUTPUT);
pinMode(SHIFT_CLK, OUTPUT);
pinMode(SHIFT_LATCH, OUTPUT);
Serial.begin(57600);
Serial.println("");
byte newdata;
for (int adr = 0; adr <= 4095; adr += 1) {
setAddress(adr);
delay(1000);
}
}
void loop() {
// put your main code here, to run repeatedly:
}