//---------------------------------------------------------------------
//     Arduino code: Serial_Send_Analog
//     Demonstrates sending data (ASCII) to the serial port
//---------------------------------------------------------------------
/*   Hardware Setup- a voltage divider connected to analog 5:
 *   1) -Wire a photoresister between +5vdc and an empty row on the breadboard
 *   2) -Wire a 10k resistor between that same row on the breadboard to ground.
 *   3) -Jumper wire from that same row to analog pin "A5"
 *-------------------------------------------------------------------------*/
int analogPin = A5;             // Variable for which analog pin to read
int analogValue = 0;           // Variable for storing analog readings

void setup() {
  Serial.begin(9600);         // start serial port at 9600 bps:  
}

void loop()
{
  // read digital input, remap 10-bit value to 8-bit:
   analogValue = analogRead(analogPin); 
//-- Uncomment the next 2 lines after you know the range (low-high) of your sensor
//   analogValue = constrain(analogValue, 0, 131);
//   analogValue = map(analogValue, 0, 131, 0, 255); // Scale data to 1-255

//-- Send one or the other (NOT BOTH): ASCII or Numbers 
  Serial.println(analogValue);   // Send analogValue to serial (USB) as ASCII
//  Serial.write(analogValue);     // Send analogValue to serial (USB) as NUMBERS

  
  delay(10);                     // pause for 10 milliseconds        
}
