  Serial.begin(9600);
  delay(100);
  
+ // first write 256 bytes to the first 256 addresses
 
  Serial.println("writing data");
  for (int i=0;i<=255;i++) {

    write2RAM(i,(byte)i);
 }
 
 Serial.println("reading data:");
 for (int i=0;i<=255;i++) {
    byte d = readRAM(i);

       digitalRead(6));
}

/**
 * wrapper function to shift out a 16 bit address and 8 bit data
 * @param address - unsigned integer with address 0x0000 - 0xffff
 * @param data    - one byte for data-bus
 **/
void shiftout(unsigned int address, byte data) {
  
  //split address to high- and low-byte
  byte lowbyte = address & 0xff;
  byte highbyte = address >> 8;
  
  //shift out all 3 bytes in the right order
  digitalWrite(LATCH,LOW);
  shiftOut(DATA,CLOCK,MSBFIRST,highbyte);
  shiftOut(DATA,CLOCK,MSBFIRST,lowbyte);
  shiftOut(DATA,CLOCK,MSBFIRST,data);
  //latch out the data
  digitalWrite(LATCH,HIGH);
  delay(10);
  digitalWrite(LATCH,LOW);
