   int flexADC = analogRead(FLEX_PIN);
   float flexV = flexADC * VCC / 1023.0;
   float flexR = R_DIV * (VCC / flexV - 1.0);
-  //Serial.println("Resistance: " + String(flexR) + " ohms");
 
   // Use the calculated resistance to estimate the sensor's bend angle:
   float angle = map(flexR, STRAIGHT_RESISTANCE, BEND_RESISTANCE, 0, 90.0);
 
   if (angle != oldFlexAngle) {
+    Serial.println("Resistance: " + String(flexR) + " ohms");
     Serial.println("Bend: " + String(angle) + " degrees");
     Serial.println();
     batteryLevelChar.setValue(angle);

    Serial.print("Connected to central: ");
    // print the central's MAC address:
    Serial.println(central.address());
    // check the battery level every 200ms
    // as long as the central is still connected:
    while (central.connected()) {
      long currentMillis = millis();
      // if 200ms have passed, check the battery level:
      if (currentMillis - previousMillis >= 200) {
        previousMillis = currentMillis;
        updateFlexAngle();

// Include BLE files.
#include <CurieBLE.h>

//###BLE Characteristics###
BLEPeripheral blePeripheral;       // BLE Peripheral Device (the board you're programming)
BLEService batteryService("180F"); // BLE Battery Service

// BLE Battery Level Characteristic
BLEUnsignedCharCharacteristic batteryLevelChar("2A19",  // standard 16-bit characteristic UUID
    BLERead | BLENotify);     // remote clients will be able to get notifications if this characteristic changes

//###Flex sensor properties###
const int FLEX_PIN = A0; // Pin connected to voltage divider output

// Measure the voltage at 5V and the actual resistance of your 47k resistor, and enter them below:
const float VCC = 4.98;       // Measured voltage of Ardunio 5V line
const float R_DIV = 47500.0;  // Measured resistance of 3.3k resistor

// Following can be adjusted to be more precise
const float STRAIGHT_RESISTANCE = 37300.0; // resistance when straight
const float BEND_RESISTANCE = 90000.0; // resistance at 90 deg

float oldFlexAngle = 0;  // last flex angle reading from analog input
long previousMillis = 0;  // last time the flex angle level was checked, in ms

void setup() 
{
