Help with standard Led Indicator Widget


#1

I apologize for this overly basic question (yes, newbie). But I cannot get the Led Indicator widget to change state when a button is pressed connected to my ESP8266. I know the device is connected and working because I am also transmitting a 0/1 representing the button state to a Text/Value widget. Following is my (non-elegant) Arduino code:

int ledPin = 4;
int buttonPin = 12;
int buttonState = 0;
bool buttonOut = false;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);

  thing.add_wifi(SSID, SSID_PASSWORD);
  thing["led"] << digitalPin(ledPin);  
  thing["button"] >> [](pson& out){
      out = buttonState;
  };
  thing["buttonLED"] >> [](pson& out){
      out = buttonOut;
  };
}

void loop() {
  buttonState = digitalRead(buttonPin);
  if (buttonState == 0) {    //button is pressed
    buttonOut = true;
  }
  else {
    buttonOut = false;
  }
  thing.handle();

I suspect the problem lies in the Setup() code. I can’t find documentation on incorporating a boolean value in Arduino code nor any documentation on the Led Indicator widget. I can confirm the widget settings point to the buttonLED resource. It is set up to sample once a second, like the Text/Value widget.


#2

Problem solved. Operator error. Documentation on how to configure the widget would have helped!