Need a "Push button" syntax to put in HTML program

Hello, First
I have connected a push button in a breadboard. When I push the button automatically it Clicks on the link in a webpage (With only pushing the button)which only I need a syntax!
I want a syntax for the push button to add to the HTML program.

Here is my program

I hope, you got what I mean!

Hi @chaudharysuyashsriva,

Let me understand your problem statement.

  1. You want to control your browser webpage with your pushbutton, right?
  2. Are you using Bolt Module to do that? Or any other Dev Board?
  3. What exactly is connected with the breadboard?
  4. Are you writing your script in a notepad? Because I believe that won’t be a good idea.

Hello @akshayan.sinha

Yes, You got it what I mean!

1.Yes, I want to control browser webpage(Onclick button) with pushbutton.
2. Yes, I am using Bolt Wifi Module.
3. *1 Push button
* Gnd to Gnd(1 leg of Button)
*GPIO 2 to 2nd leg of Button

  1. I have written the script in Bolt IoT Cloud

I hope you get it.

Thanks for reply !

@chaudharysuyashsriva

How familiar are you with https://cloud.boltiot.com/static/js/boltCommands.js functions? I see that you are an old user.

@chaudharysuyashsriva

You can use digitalRead function and call it every 2- 3 seconds using

setInterval(function(){ 
   digitalRead(pin,element_id);
}, 3000);

Inside digitalRead, make changes. So that when obj.value = “1”, you can run

window.open(url,'_blank'); //url is the webpage link

You’ll find the function over here https://cloud.boltiot.com/static/js/boltCommands.js

If you’re not familiar with javascript, then you need to start with basic programs and functions to get a grip. For that you can take help of this thread boltCommand.js - All functions explained - w/ Syntax and HTML samples 🦾

Hello @akshayan.sinha
I do whatever you said to me, but as usual it nothing happen! :frowning:
I don’t know why it does not click on Link(Webpage) after pushing the button.
I think I should send you a whole code :

As per the screenshot, you haven’t done anything as I have said.
You might not have the exact idea of how to use the functions.

Go through the above thread, it has the functions as well as the sample mentioned in it.

Once you get an idea,

Hello @akshayan.sinha I have read all the syntax ! But couldn’t get it.
Okay let’s make it simple
On this screen shot, can u edit or draw the corrections, so that I would change it! At this correction I can see where I am wrong !

Hi @chaudharysuyashsriva,

The most important part, there is no digitalRead in the notepad script you sent.

Since you’re a beginner, I suggest you go through a workshop video, i.e. Custom Dashboard for BoltIoT

Along with tht, you can go through the code in here, BoltIoT-Workshop-Scripts/Read Functions/w Pro at master · hippyaki/BoltIoT-Workshop-Scripts · GitHub

Before you start with writing your code, I suggest you to understand the concept from the links I video and the code I have provided to you.

Then you 'll be able to relate with this -