shiftIn to go with shiftOut

Thanks Lee:

I have tried to lift the shiftIn function to put it into my code. It will not compile so something is seriously wrong. I should not have to use the latch chip they are interfacing to in order to use this function, or do I?

I have put my code in to hopefully make it clear what I am doing and how I am trying to use this function.

I switched my driving pins between the DS1306 and the MAX7219 so that the DS1306 is now connected to the supported SPI pins on the Arduino Diecimila that I am using. I guess I could try the code from the SPI examples now that I am using the supported pins. I guess I don't understand how to read a digital input to capture a byte.

I have done this before on a PICAXE and on a Microchip but that was in basic and assembler. I am trying to learn "C".

Any help troubleshooting this or posting an alternate strategy to read the response after sending the address would be appreciated. Here is the code.

oops, code got trimmed by character limit so here is the function where I am calling the shiftIn function

void read_DS1306(byte address, byte cldata)              //Function to write to DS1306
{
// Chip Select is active high
digitalWrite(CLOCK1306, HIGH);                           //Specified in Data Sheet
digitalWrite(CHIPSL1306, HIGH);                          //Select DS1306
shiftOut(OUT1306, CLOCK1306, MSBFIRST, claddress);       //send the register address we want to write to
shiftIn(int IN1306, int CLOCK1306);                      //read the clock register
digitalWrite(CHIPSL1306, LOW);                           //Deselect DS1306
//Send Values to Message Window
Serial.print(" Read Clock Address ");                    //Displays value of Register Address
Serial.println(address, HEX);                            //
Serial.print(" Read Data ");                             //Displays value written to "Data"
Serial.println(cldata, HEX);
delay(50);
}

This is the error message I get

error: expected ',' or '...' before numeric constant In function 'void read_DS1306(byte, byte)':
 At global scope:
 In function 'byte shiftIn(int)':

This is the shiftIn function changed to my DS1306 pin labels

byte shiftIn(int IN1306, int CLOCK1306) 
{ 
  int i;
  int temp2 = 0;
  int pinState;
  byte cldata = 0;
  for (i=7; i>=0; i--)
  {
  digitalWrite(CLOCK1306, 1);
  delayMicroseconds(2);
  cldata = digitalRead(IN1306);
    if (cldata) 
    {
    pinState = 1;
    //set the bit to 0 no matter what
    cldata = cldata | (1 << i);
    }
      else 
    {
    pinState = 0;
    }
    digitalWrite(CLOCK1306, 0);
  Serial.println(cldata, BIN);
  return cldata;
  }

These are the pin definitions

#define OUT1306      11       //Master Out Slave In DS1306
#define IN1306       12       //Master In Slave Out DS1306
#define CLOCK1306    13       //Serial Clock DS1306
#define CHIPSL1306   10       //Chip Select DS1306