Help coding a button

The following links into an “Arduino” project. I modified the following tutorial.

I am needing to add a second button i.e. changing the toggle switch to a button.

I copied the below part

String processor(const String& var){
//Serial.println(var);
if(var == "SLIDERPLACEHOLDER"){
String buttons ="";
String outputStateValue = outputState();
buttons+= "<h4>Lights <span id=\"outputState\"><span></h4><label class=\"switch\"><input type=\"checkbox\" onchange=\"toggleCheckbox(this)\" id=\"output\" " + outputStateValue + "><span class=\"slider\"></span></label>";
return buttons;
}

And started making changes so that it looks like

if(var == "BUTTONPLACEHOLDER"){
String buttons ="";
String outputStateValue = outputState();
buttons+= "<h4>Patten <span id=\"outputState\"><span></h4><label class=\"button\"><input type=\"button\" id=\"output\" " + outputStateValue + "><span class=\"button\"></span></label>"; //Need to display gCurrentPatternNumber somehow

As you will see, the Pattern button does display correctly
BrowserScreen

I am guessing that

  1. I have not changed the code correctly
  2. I need more CSS
  3. I need an extra script

I am not needing help with the “C” coding or the electronics, just the HTML, CSS and scripting.

The code for the project can be found here

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.