Friday, July 8, 2016

ESP8266 Buzzer

Tested passive Buzzer with ESP8266 development board and ESP8266Basic.
Buzzer (+)  is connected to pin 15 (Where also RGB led is connected) . Other pin connected to GND.

If buzzer is connected to "not RGB pins" ( 0 ,2 4, 5, 14 ,16) the corresponding led lights up.
Program to test buzzer:
High and Low buttons are not PWM
only added for testing


cls
let d = 15
' Connect Buzzer to GND and pin 'd'

let v = 0

html | <h1>Test Buzzer</h1> |
html | <br> |

button "Low" , [SetPinLow]
button "High" , [SetPinHigh]

html | <br><br> |

button "SetSliders" , [SetSliders]
button " 0 " , [SlidersOff]
slider v , 0 , 500
button "MAX" , [SlidersMAX]


html | <br><br> |

button " Exit ", [Exit]

wait

[SetPinLow]
io(po,d,0)
wait
[SetPinHigh]
io(po,d,1)
wait


[SlidersMAX]
let v = 500
Goto [SetSliders]

[SlidersOff]
let v = 0
[SetSliders]
io(pwo,d,v)
wait

[Exit]
cls
end


No comments: