How to plot graph for buzzer?

i m not able to make the graph


Buzzer is an output-based device. Like an LED, it’ll work as an OUTPUT. What kind of graph are you planning for to build with a buzzer?

Any kind of graph or plotting a chart is always based on inputs taken from the Bolt module or any other device.

You can use the LDR or LM35 to use with bolt module and plot the inputs on the graph.

I expected a line graph which remains at 1 as long as buzzer is ON and at 0 as long as buzzer is OFF. But the graph I get is just a straight line at 0, irrespective of whether the buzzer is ON/OFF. (Screenshot attached)

How to correct this??

have you made the connection correctly?and also the coding you typed is completely the same as shown in the course?

The connections are correct, I believe. Positive leg of buzzer to pin 0 and negative leg to pin GND. The code I have attached as a screenshot.(My bad, forgot it earlier!!!)

ok… once you try with html… if u need any help for html code then let me know,i will provide you

Could u help how to plot graph using HTML code??

zoom it and go for it…if any query ,let me know

Thanks for the code. But the assignment wants us to have a graph and vary the values like setting cross hair and so on. So for that can we use HTML code???

yes obviously,go for it and make the graph…the process will be same as javascript,just try it…i hope you can do that…

I wrote the code this way, but it wasn’t of any help… Where did I go wrong??


You can use a pin to either READ the value or WRITE the value. You cannot do both at the same time.

So, there is no way, you can check whether the pin is ON or OFF. You can only control it, OR read it.

Oo ok then.
Thanks for helping me out @Amrita_dey @akshayan.sinha

Buzzer is an output device, You cannot get any data from the Buzzer.