//Arduino Touch Sensor

   
int fsrAnalogPin = A0; // FSR is connected to analog 0 int LEDpin = 8; // connect Red LED to pin 8 (PWM pin) int fsrReading; // the analog reading from the FSR resistor divider int LEDbrightness; void setup(void) { Serial.begin(9600); // We'll send debugging information via the Serial monitor pinMode(LEDpin, OUTPUT); } void loop(void) { fsrReading = analogRead(fsrAnalogPin); int num=fsrReading/5; Serial.print("Analog reading = "); Serial.println(num); // used by analogWrite (0-255) with map! LEDbrightness = map(num, 0, 1023, 0, 255); // LED gets brighter the harder you press analogWrite(LEDpin, LEDbrightness); delay(100); }