user3518: I am having problems controlling a 3.5" Floppy Disk Drive with an Arduino Uno.  
I have the floppy disk drive powered with a computer power supply that is switched on, and the Arduino powered by my computer's USB.  I have cut apart the ribbon of a 34-pin IDC connector to be able to route the pins to my Arduino.  I am able to turn the floppy disk motor on and move the read/write head back and forth, but I am never able to read any pulses from the Track-0 or Index pins.  
I have pins 7, 15, 17, 19, and 25 from the floppy all grounded to my Arduino, and I have pins 8, 16, 18, 20, and 26 from the floppy connected to my arduino as output pins so I can control the drive. 
I am expecting the Index to pulse when the disk motor makes a rotation, and for Track 0 to change when I am at the outside of the disk, but they are both always LOW.  Am I missing something?
Here is the spec I found for the back of the floppy disk unit
    2   /REDWC  Input Density Select
    4   n/c N/A Reserved
    6   n/c N/A Reserved
    8   /INDEX  Output Index
    10  /MOTEA  Input Motor Enable A 
    12  /DRVSB  Input Drive Sel B
    14  /DRVSA  Input Drive Sel A 
    16  /MOTEB  Input Motor Enable B
    18  /DIR    Input Direction
    20  /STEP   Input Step 
    22  /WDATE  Input Write Data
    24  /WGATE  Input Floppy Write Enable
    26  /TRK00  Output Track 0
    28  /WPT    Output Write Protect
    30  /RDATA  Output Read Data
    32  /SIDE1  Input  Head Select
    34  /DSKCHG Output Disk Change/Ready

Here a schematic of what I have hooked up
(The breadboard in this circuit diagram represents the IDC connector that is plugged into the 3.5" floppy drive.)

Here is a photo of the IDC Connector and I labelled which wires are connected to the Arduino.

Here's the code I am running.
//constants
static const int IN = LOW;
static const int OUT = HIGH;
static const int pulseDelayTime = 6;

//pins
int indexPin = 2; //8 on the drive INDEX
int track0Pin = 3; //26 on the drive. TRACK 0
int dirPin = 6; //18 on the drive. DIRECTION
int stepPin = 7; //20 on the drive. STEP
int motorEnableBPin = 9; //16 on the drive. MOTOR ENABLE B

unsigned long motorSpinTime = 1000UL; //in ms


void setup() {

  //initial delay
  delay(3000);

  //setup serial monitor
  Serial.begin(9600);      

  //setup pins.
  pinMode(dirPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(motorEnableBPin, OUTPUT);
  pinMode(indexPin, INPUT);
  pinMode(track0Pin, INPUT);

  //turn the motor off initially
  digitalWrite(motorEnableBPin, HIGH);

  //print state here.
  printState("Setup done.");

  //spin the disk some.
  printState("Begin to spin motor");
  spinMotorForThisManyMs(motorSpinTime);
  spinMotorForThisManyMs(motorSpinTime);
  printState("Done spinning motor");

  //step read/write head all the way in.
  stepAllTheWayIn();

  //spin the disk some more.
  printState("Begin to spin motor");
  spinMotorForThisManyMs(motorSpinTime);
  spinMotorForThisManyMs(motorSpinTime);
  printState("Done spinning motor");

  //step read/write head all the way out.
  stepAllTheWayOut();

  //spin the disk even more.
  printState("Begin to spin motor");
  spinMotorForThisManyMs(motorSpinTime);
  spinMotorForThisManyMs(motorSpinTime);
  printState("Done spinning motor");

  //never completes.
  waitForIndex();
}

void loop() {
}

//spins the disk motor for a number of ms and prints the state
void spinMotorForThisManyMs(unsigned long msToSpin) {

  //start spinning
  digitalWrite(motorEnableBPin,LOW);

  //delay.. keep printing the state
  unsigned long maxTimeMs = millis() + msToSpin;  
  while(millis() < maxTimeMs ) {
    printState("Spinning");    
  }

  //stop spinning
  digitalWrite(motorEnableBPin,HIGH);
}



//step the read/write head all the way to the center
void stepAllTheWayIn() {
  for(int i=0;i<100;i++) {
    printState("Stepping In");
    stepInALittle();
  }
}

//step the read/write head all the way to the outside
void stepAllTheWayOut() {
  for(int i=0;i<100;i++) {
    printState("Stepping Out");
    stepOutALittle();
  }
}

//print the state of the index and track
void printState(const char* charPrint) {
  Serial.print(" Index:");
  Serial.print(digitalRead(indexPin));
  Serial.print(" Track:");
  Serial.print(digitalRead(track0Pin));
  Serial.print(" ");
  Serial.println(charPrint);
}

//move the head towards the outside a little
void stepOutALittle() {
  digitalWrite(dirPin,HIGH);
  stepPulse();
}

//move the head towards the center a little
void stepInALittle() {
  digitalWrite(dirPin,LOW);
  stepPulse();
}

//pulse the step pin
void stepPulse() {
  digitalWrite(stepPin,LOW);
  delay(pulseDelayTime);
  digitalWrite(stepPin,HIGH);
}

//waits for the index to trigger. this never gets completed.
void waitForIndex() {

  printState("beginning to wait for index pin to pulse");

  //start spinning
  digitalWrite(motorEnableBPin,LOW);

  //wait for pulse
  while(digitalRead(indexPin));
  //wait for end of pulse 0
  while(!digitalRead(indexPin));

  printState("end of waiting for index pin to pulse");

  //stop spinning
  digitalWrite(motorEnableBPin,HIGH);
}

Here is the output I am getting. 
 Index:0 Track:0 Setup done.
 Index:0 Track:0 Begin to spin motor
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Done spinning motor
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Begin to spin motor
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Done spinning motor
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Begin to spin motor
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Done spinning motor
 Index:0 Track:0 beginning to wait for index pin to pulse

UPDATE:
I am now receiving my expected results due to geometrikal's answer.   While researching this problem I found a few code examples of Arduino to Floppy Drive. I noticed that they were setting their input pins to HIGH, but I never realized why they were doing this.  After fixing my problem, I found this in some Arduino documentation (which made me realize the code examples I had were using an older version of the Arduino IDE):  
"Prior to Arduino 1.0.1, it was possible to configure the internal pull-ups      in the following manner:"
pinMode(pin, INPUT);           // set pin to input
digitalWrite(pin, HIGH);       // turn on pullup resistors`

In Arduino 1.0.1+ you can do it this way.
pinMode(pin, INPUT_PULLUP);


user84: You should replace int with unsigned long in all locations where you deal with time in milliseconds.
The point is that millis() returns an unsigned long, thus using int to store millis() value, you have a loss of information due to automatic cast performed by the compiler.
The changes you have to perform are:
unsigned long motorSpinTime = 1000UL; //in ms

and:
//spins the disk motor for a number of ms and prints the state
void spinMotorForThisManyMs(unsigned long msToSpin) {

  //start spinning
  digitalWrite(motorEnableBPin,LOW);

  //delay.. keep printing the state
  unsigned long maxTimeMs = millis() + msToSpin;  
  while(millis() < maxTimeMs ) {
    printState("Spinning");    
  }

  //stop spinning
  digitalWrite(motorEnableBPin,HIGH);
}

Note that I have also performed some optimization in the waiting loop by calculating the maximum time once and then compare millis() directly to that value. This is not mandatory but I just find it a bit more clean.

user1566: According to this (dead link):
http://bitsavers.trailing-edge.com/pdf/nec/FD1035_Product_Description_Jul84.pdf

This is an archived copy of the FD1035 3.5" Floppy disk drive: Product Description July 1984 - PDF:
https://archive.org/details/bitsavers_necFD1035Pl84_876629

The outputs are open-collector, so a pull-up resistor is required. You can instead enable the Arduino internal pull-ups on those pins by
pinMode(indexPin, INPUT_PULLUP);
pinMode(track0Pin, INPUT_PULLUP);


3518: <p>I am having problems controlling a 3.5" Floppy Disk Drive with an Arduino Uno.  </p>

<p>I have the floppy disk drive powered with a computer power supply that is switched on, and the Arduino powered by my computer's USB.  I have cut apart the ribbon of a 34-pin IDC connector to be able to route the pins to my Arduino.  I am able to turn the floppy disk motor on and move the read/write head back and forth, but I am never able to read any pulses from the Track-0 or Index pins.  </p>

<p>I have pins 7, 15, 17, 19, and 25 from the floppy all grounded to my Arduino, and I have pins 8, 16, 18, 20, and 26 from the floppy connected to my arduino as output pins so I can control the drive. </p>

<p>I am expecting the Index to pulse when the disk motor makes a rotation, and for Track 0 to change when I am at the outside of the disk, but they are both always LOW.  Am I missing something?</p>

<p><strong>Here is the spec I found for the back of the floppy disk unit</strong></p>

<pre><code>    2   /REDWC  Input Density Select
    4   n/c N/A Reserved
    6   n/c N/A Reserved
    8   /INDEX  Output Index
    10  /MOTEA  Input Motor Enable A 
    12  /DRVSB  Input Drive Sel B
    14  /DRVSA  Input Drive Sel A 
    16  /MOTEB  Input Motor Enable B
    18  /DIR    Input Direction
    20  /STEP   Input Step 
    22  /WDATE  Input Write Data
    24  /WGATE  Input Floppy Write Enable
    26  /TRK00  Output Track 0
    28  /WPT    Output Write Protect
    30  /RDATA  Output Read Data
    32  /SIDE1  Input  Head Select
    34  /DSKCHG Output Disk Change/Ready
</code></pre>

<p><strong>Here a schematic of what I have hooked up</strong>
<strong><em>(The breadboard in this circuit diagram represents the IDC connector that is plugged into the 3.5" floppy drive.)</em></strong></p>

<p><img src="https://i.stack.imgur.com/pEHOT.png" alt="Floppy &amp; Arduino Connections"></p>

<p><strong>Here is a photo of the IDC Connector and I labelled which wires are connected to the Arduino.</strong></p>

<p><img src="https://i.stack.imgur.com/DdFX0.jpg" alt="Labelled IDC Connector"></p>

<p><strong>Here's the code I am running.</strong></p>

<pre><code>//constants
static const int IN = LOW;
static const int OUT = HIGH;
static const int pulseDelayTime = 6;

//pins
int indexPin = 2; //8 on the drive INDEX
int track0Pin = 3; //26 on the drive. TRACK 0
int dirPin = 6; //18 on the drive. DIRECTION
int stepPin = 7; //20 on the drive. STEP
int motorEnableBPin = 9; //16 on the drive. MOTOR ENABLE B

unsigned long motorSpinTime = 1000UL; //in ms


void setup() {

  //initial delay
  delay(3000);

  //setup serial monitor
  Serial.begin(9600);      

  //setup pins.
  pinMode(dirPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(motorEnableBPin, OUTPUT);
  pinMode(indexPin, INPUT);
  pinMode(track0Pin, INPUT);

  //turn the motor off initially
  digitalWrite(motorEnableBPin, HIGH);

  //print state here.
  printState("Setup done.");

  //spin the disk some.
  printState("Begin to spin motor");
  spinMotorForThisManyMs(motorSpinTime);
  spinMotorForThisManyMs(motorSpinTime);
  printState("Done spinning motor");

  //step read/write head all the way in.
  stepAllTheWayIn();

  //spin the disk some more.
  printState("Begin to spin motor");
  spinMotorForThisManyMs(motorSpinTime);
  spinMotorForThisManyMs(motorSpinTime);
  printState("Done spinning motor");

  //step read/write head all the way out.
  stepAllTheWayOut();

  //spin the disk even more.
  printState("Begin to spin motor");
  spinMotorForThisManyMs(motorSpinTime);
  spinMotorForThisManyMs(motorSpinTime);
  printState("Done spinning motor");

  //never completes.
  waitForIndex();
}

void loop() {
}

//spins the disk motor for a number of ms and prints the state
void spinMotorForThisManyMs(unsigned long msToSpin) {

  //start spinning
  digitalWrite(motorEnableBPin,LOW);

  //delay.. keep printing the state
  unsigned long maxTimeMs = millis() + msToSpin;  
  while(millis() &lt; maxTimeMs ) {
    printState("Spinning");    
  }

  //stop spinning
  digitalWrite(motorEnableBPin,HIGH);
}



//step the read/write head all the way to the center
void stepAllTheWayIn() {
  for(int i=0;i&lt;100;i++) {
    printState("Stepping In");
    stepInALittle();
  }
}

//step the read/write head all the way to the outside
void stepAllTheWayOut() {
  for(int i=0;i&lt;100;i++) {
    printState("Stepping Out");
    stepOutALittle();
  }
}

//print the state of the index and track
void printState(const char* charPrint) {
  Serial.print(" Index:");
  Serial.print(digitalRead(indexPin));
  Serial.print(" Track:");
  Serial.print(digitalRead(track0Pin));
  Serial.print(" ");
  Serial.println(charPrint);
}

//move the head towards the outside a little
void stepOutALittle() {
  digitalWrite(dirPin,HIGH);
  stepPulse();
}

//move the head towards the center a little
void stepInALittle() {
  digitalWrite(dirPin,LOW);
  stepPulse();
}

//pulse the step pin
void stepPulse() {
  digitalWrite(stepPin,LOW);
  delay(pulseDelayTime);
  digitalWrite(stepPin,HIGH);
}

//waits for the index to trigger. this never gets completed.
void waitForIndex() {

  printState("beginning to wait for index pin to pulse");

  //start spinning
  digitalWrite(motorEnableBPin,LOW);

  //wait for pulse
  while(digitalRead(indexPin));
  //wait for end of pulse 0
  while(!digitalRead(indexPin));

  printState("end of waiting for index pin to pulse");

  //stop spinning
  digitalWrite(motorEnableBPin,HIGH);
}
</code></pre>

<p><strong>Here is the output I am getting.</strong>  </p>

<pre><code> Index:0 Track:0 Setup done.
 Index:0 Track:0 Begin to spin motor
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Done spinning motor
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Stepping In
 Index:0 Track:0 Begin to spin motor
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Done spinning motor
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Stepping Out
 Index:0 Track:0 Begin to spin motor
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Spinning
 Index:0 Track:0 Done spinning motor
 Index:0 Track:0 beginning to wait for index pin to pulse
</code></pre>

<p><strong>UPDATE:</strong>
I am now receiving my expected results due to geometrikal's answer.   While researching this problem I found a few code examples of Arduino to Floppy Drive. I noticed that they were setting their input pins to HIGH, but I never realized why they were doing this.  After fixing my problem, I found this in some Arduino documentation (which made me realize the code examples I had were using an older version of the Arduino IDE):  </p>

<p>"Prior to Arduino 1.0.1, it was possible to configure the internal pull-ups      in the following manner:"</p>

<pre><code>pinMode(pin, INPUT);           // set pin to input
digitalWrite(pin, HIGH);       // turn on pullup resistors`
</code></pre>

<p>In Arduino 1.0.1+ you can do it this way.</p>

<pre><code>pinMode(pin, INPUT_PULLUP);
</code></pre>
 84: <p>You should replace <code>int</code> with <code>unsigned long</code> in all locations where you deal with time in milliseconds.</p>

<p>The point is that <code>millis()</code> returns an <code>unsigned long</code>, thus using <code>int</code> to store <code>millis()</code> value, you have a loss of information due to automatic cast performed by the compiler.</p>

<p>The changes you have to perform are:</p>

<pre><code>unsigned long motorSpinTime = 1000UL; //in ms
</code></pre>

<p>and:</p>

<pre><code>//spins the disk motor for a number of ms and prints the state
void spinMotorForThisManyMs(unsigned long msToSpin) {

  //start spinning
  digitalWrite(motorEnableBPin,LOW);

  //delay.. keep printing the state
  unsigned long maxTimeMs = millis() + msToSpin;  
  while(millis() &lt; maxTimeMs ) {
    printState("Spinning");    
  }

  //stop spinning
  digitalWrite(motorEnableBPin,HIGH);
}
</code></pre>

<p>Note that I have also performed some optimization in the waiting loop by calculating the maximum time once and then compare <code>millis()</code> directly to that value. This is not mandatory but I just find it a bit more clean.</p>
 1566: <p>According to this (dead link):</p>

<p><a href="http://bitsavers.trailing-edge.com/pdf/nec/FD1035_Product_Description_Jul84.pdf" rel="nofollow noreferrer">http://bitsavers.trailing-edge.com/pdf/nec/FD1035_Product_Description_Jul84.pdf</a></p>

<blockquote>
  <p><em>This is an archived copy of the <a href="https://ia801902.us.archive.org/3/items/bitsavers_necFD1035Pl84_876629/FD1035_Product_Description_Jul84.pdf" rel="nofollow noreferrer">FD1035 3.5" Floppy disk drive: Product Description July 1984 - PDF</a>:</em></p>
  
  <p><em><a href="https://archive.org/details/bitsavers_necFD1035Pl84_876629" rel="nofollow noreferrer">https://archive.org/details/bitsavers_necFD1035Pl84_876629</a></em></p>
</blockquote>

<p>The outputs are open-collector, so a pull-up resistor is required. You can instead enable the Arduino internal pull-ups on those pins by</p>

<pre><code>pinMode(indexPin, INPUT_PULLUP);
pinMode(track0Pin, INPUT_PULLUP);
</code></pre>
