long value = 0; digitalWrite(dataline[0], HIGH); shiftoutAddress(0xA130F1/2); Serial.println("START"); // we get 2 bytes at every address for (unsigned long x=(0x200001/2); x < (0x002003ff/2); x++) { shiftoutAddress(x); value = readDatalinePins(); byte byte1 = 0; byte byte2 = 0; byte1 = (byte) (value >> 8); byte2 = (byte) (value & 0xff); Serial.println(byte1, DEC); Serial.println(byte2, DEC); Serial.println("END"); // read data pins unsigned long readDatalinePins() { // change to data lines to inputs for (int i = 0; i < 16; i++) { pinMode(dataline[i], INPUT); } unsigned long value = 0; // loop through and read the 16 data lines // write a 0/1 bit at each position in the variable named "value" // // eg. address line 1 is high (write 1 to bit location 1 on the variable named "value") // address line 5 is low (write 0 to bit location 5 on the variable named "value") for (int z = 0; z < 16; z++) { if (digitalRead(dataline[z]) == HIGH) { bitWrite(value, z, HIGH); } } return value; } // takes a long memory address // turns on/off (+5v/0v) address line according to memory address void shiftoutAddress(unsigned long shiftAddress) { // change address lines to outputs for (int i = 0; i < 23; i++) { pinMode(addressline[i], OUTPUT); } // loop through all 23 addresses for (int z = 0; z < 23; z++) { // read the bit value (0/1) of the supplied shiftAddress // enable +5v/0v to the appropriate address pin if (bitRead(shiftAddress, z) == HIGH) { digitalWrite(addressline[z], HIGH); } else { digitalWrite(addressline[z], LOW); } } }