 long btnUpTime; // time the button was released
 boolean ignoreUp = false; // whether to ignore the button release because the click+hold was triggered
 boolean ledVal1 = false; // state of LED 1
-int AnalogDataPin = A1; // this may be changed depending on circuit wiring
+int AnalogDataPin = A0; // this may be changed depending on circuit wiring
 int Count;
 float Voltage;
 float SensorReading;

/*
VernierAnalogStore
Reads a Vernier analog (BTA) Sensor connected to pin A0 of the Arduino and and stores  the data in the non-volatile EEPROM memory of the Arduino.
This sketch displays the time and sensor readings on the Serial Monitor. 
As written, the readings will be displayed every half second. 
Change the variable TimeBetweenReadings to change the rate.
Change the variable NumberOfReadings to change the number of data points to take.
 See www.vernier.com/arduino for more information, especially for information on how this sketch can be used to collect remote data with the Arduino away from a computer.
 Thanks to B. Huang, for help on this program, especially the structure of a program to store and retrieve data.
*/
int buttonPin= 12; // analog input pin to use as a digital input
int ledPin1= 13; // digital output pin for LED 1 indicator

  Serial.println(Units);  
  for (i = 0; i <(NumberOfPointsRead)*2; i+=2)
   {
      Count = EEPROM.read(base+2 + i) | EEPROM.read(base+2 + i + 1) << 8;   
      //the print below does the division first to avoid overflows
      Serial.print(i/2/1000.0*TimeBetweenReadings);  
      Serial.print("\t");                // print a tab character 
      Voltage = Count  * (5.0/ 1024);
      SensorReading= Intercept + Voltage * Slope;
      Serial.println(SensorReading);
   }
  Serial.println(" ");
  Serial.println("Press and hold button to collect new data ");
  Serial.println(" ");
  digitalWrite(ledPin1, false); //turn off LED
  //end of send data to Serial Monitor
}

void CollectData() //Collect Data
{
  ledVal1 = !ledVal1;
  Serial.begin(9600);
  Serial.println("Collecting Data...");
  Serial.println(" ");
  int Sample = 0;// local variable
  unsigned long StartTime =0;
  int addr = base+ 2; //starting address of memory for data storage
  //note addr is later incremented
  Serial.println( "Vernier Format 2");
  Serial.print(NumberOfPoints);
  Serial.print(" readings taken with a Vernier ");
  Serial.println(SensorName);
