What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

Help coding a button

htmllearner

New member
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.png

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.

Thanks :)
 

Attachments

  • RainbowLights.ino.txt
    9 KB · Views: 0
Back
Top