AC Dimmer DevBoard – MPDMv7.5 – Part 2

For a more detailed description please take a look at the Part 1: MPDMv7.5 AC Dimmer devboard overview

MPDMv7.5 AC Dimmer devboard ESP Basic program example for the basic version configuration:

'write("starttimer",10)
cls

'VCNT GPIO pin
let pinNo = 13 
'ON-OFF GPIO pin
let off = 16

io(po,off,0)

' Software option for Light FULL ON at power-up
' working only when the hardware ON-OFF function is activated
'stat = "on"
'let sw = 0

' Software option for Light FULL OFF at power-up
' working only when the hardware ON-OFF function is activated
stat = "off"
let sw = 1

let b1 = 800 
let b2 = 850 
let b3 = 890 
let b4 = 550
let b5 = 650 
let b6 = 750 
let b7 = 850

wprint " <b>MPDMv7 - MAINS AC Dimmer Dev Board <br>demo driver</b><br><i>by tech@esp8266-projects.com</i><br><br> " 
t = 0
timer 300, [start]

print "Control PIN" 
textbox pinNo 
wprint "<br>"
wprint "<br>"
wprint " Brightness" 
textbox b1 
button " Set Brightness ",[Setb1] 
wprint "<br>"
wprint " Brightness" 
textbox b2 
button " Set Brightness ",[Setb2] 
wprint "<br>"
wprint " Brightness" 
textbox b3 
button " Set Brightness ",[Setb3] 
wprint "<br>"
wprint " Brightness" 
textbox b4 
button " Set Brightness ",[Setb4] 
wprint "<br>"
wprint " Brightness" 
textbox b5 
button " Set Brightness ",[Setb5] 
wprint "<br>"
wprint " Brightness" 
textbox b6 
button " Set Brightness ",[Setb6] 
wprint "<br>"
wprint " Brightness" 
textbox b7 
button " Set Brightness ",[Setb7] 
wprint "<br>"

wprint "<br>"
textbox stat
button " ON/OFF ",[off] 
wprint "<i><t> -> Press first for hardware ON/OFF function !!</i><br>"

button " Exit ", [TestExit] 
wait

[start]
io(po,2,0)
delay 100
io(po,2,1)
t = t + 1
if t = 5 then
 timer 0 
end if
wait

[off]
if sw = 0 then
 stat = "off"
 sw = 1
 io(po,off,0)
else 
 stat = "on"
 sw = 0
 io(po,off,1)
endif
wait

[Setb1] 
io(pwo,pinNo,b1)
wait

[Setb2] 
io(pwo,pinNo,b2)
wait

[Setb3] 
io(pwo,pinNo,b3)
wait

[Setb4] 
io(pwo,pinNo,b4)
wait

[Setb5] 
io(pwo,pinNo,b5)
wait

[Setb6] 
io(pwo,pinNo,b6)
wait

[Setb7] 
io(pwo,pinNo,b7)
wait

[TestExit] 
Wprint | <br><br><a href="./edit"> Click here to go to <b>Edit</b> </a> |
end
Scroll to Top