Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By trackerj
#46701 Done first MPDMv4 AC Dimmer Driver test using the ESP8266 nEXT EVO Board with 512k ESPBasic firmware.

Example code below:

Code: Select allcls
let pinNo = 5
let Brightness = 890
print "Control PIN"
textbox pinNo
print " Brightness"
textbox Brightness
button " Set Brightness " [SetBrightness]
button " Exit " [TestExit]
wait

[SetBrightness]
pwo pinNo Brightness
wait

[TestExit]
end


and the result:

ESPBasic_PWM_test_1.jpg



Because the VCNT range is calibrated for the used 105W Halogen ECO lightbulb from 0-2.8V the 'Brightness' values are going from:

-> '0' - max light
to
-> '880' - lowest light
-> '890' - full off

Working like a charm. Code above can tell anybody how deadly simple is to use MPDMv4 Driver.

Will do a more detailed video with ESPBasic code example in the next days.

PS: where can I find in EU a 110/120V US standard lightbulb ? :) Asking about EU because I really don't want to think about asking somebody to sent it over the big pond without trying also this option.
You do not have the required permissions to view the files attached to this post.
User avatar
By forlotto
#46734 Give this a try once

Code: Select allbutton "OFF" [OFF]
button "1" [1]
button "2" [2]
button "3" [3]
button "4" [4]
button "5" [5]
button "fun" [fun]
wait

[OFF]
pwo D4 0
pwo D4 0
wait

[1]
pwo D4 180
wait

[2]
pwo D4 200
wait

[3]
pwo D4 220
wait

[4]
pwo D4 260
wait

[5]
pwo D4 400
wait

[fun]
pwo D4 180
delay 100
pwo D4 200
delay 100
pwo D4 220
delay 100
pwo D4 240
delay 100
pwo D4 260
delay 100
pwo D4 280
delay 100
pwo D4 300
delay 100
pwo D4 320
delay 100
pwo D4 340
delay 100
pwo D4 360
delay 100
pwo D4 380
delay 100
pwo D4 400
delay 100
pwo D4 380
delay 100
pwo D4 360
delay 100
pwo D4 340
delay 100
pwo D4 320
delay 100
pwo D4 300
delay 100
pwo D4 280
delay 100
pwo D4 260
delay 100
pwo D4 240
delay 100
pwo D4 220
delay 100
pwo D4 200
delay 100
pwo D4 180
delay 100
pwo D4 160
wait


120v bulb should be at any hardware store or store that sells tools EU carries both types of bulbs just like the US last I looked otherwise ebay is always an option hrmmm I suppose I could send one if you can't figure something out as well gimme your info via PM and I'll ship you one only issues I am not sure if it is ROHS compliant will they stop shipment if it is not or will I get fined etc? Dunno don't ship much to the UK pretty strict laws over that way so dunno.

From what I noticed even is that max brightness is actually about 400 from my testing anything above that there is little or zero difference if I had lumen meter I would verify but I do not but after days of messing around this is what I found worked as I said anything above that level is just a waste in my testing nothing notable.

I have an LED bulb and a CFL bulb I could send you don't have any incandescent currently I took the last two back to the store because the light was a little on the yellow side to my liking. These are both dimmable bulbs.

Anyhow let me know what you come up with sorry man right now I just got done with all my house chores after working about 11hrs. Every day is going to be overtime for me so I may not be able to reply until it is too late sorry about that no cell phone policy at work etc... so I just wait until I get home to do any communications stuff or internet based responses once in a while I will do some at lunch or something but very rarely.

But Cicciocb is one of the developers of basic glad he chimed in and helped out! The other is mmiscool.

PS 4MB flash is for ESP12 512k flash is for ESP01 ESP07 I believe you can use 512k and it will not hurt anything but you have less to work with.

Other than that what do you think of basic pretty cool interface aye you can see this makes life a lot easier! Hope you stick around and share some video or something of some of your projects ;)

So far so good I think your example should work fine.

Thanks again for coming on over and checking us out I like a lot of your hardware concepts actually I have read about them before I knew about basic some time back when I did a couple of LUA based programs but the dimmer circuit has improved quite a bit as there has been a bit of an evolution with the dimmer board from when I read about it the first time many improvements and that is what caught my attention the most.

Anything else you need help with trackerj just let me know and I will respond as soon as I possibly can may be kind of relayed and you might have to wait until the next day if someone else does not answer by then but I'll do my best with all the long hours at my job.
User avatar
By trackerj
#47238
forlotto wrote:Give this a try once

Code: Select allbutton "OFF" [OFF]
button "1" [1]
button "2" [2]
button "3" [3]
button "4" [4]
button "5" [5]
button "fun" [fun]
wait

[OFF]
pwo D4 0
pwo D4 0
wait

[1]
pwo D4 180
wait

[2]
pwo D4 200
wait

[3]
pwo D4 220
wait

[4]
pwo D4 260
wait

[5]
pwo D4 400
wait

[fun]
pwo D4 180
delay 100
pwo D4 200
delay 100
pwo D4 220
delay 100
pwo D4 240
delay 100
pwo D4 260
delay 100
pwo D4 280
delay 100
pwo D4 300
delay 100
pwo D4 320
delay 100
pwo D4 340
delay 100
pwo D4 360
delay 100
pwo D4 380
delay 100
pwo D4 400
delay 100
pwo D4 380
delay 100
pwo D4 360
delay 100
pwo D4 340
delay 100
pwo D4 320
delay 100
pwo D4 300
delay 100
pwo D4 280
delay 100
pwo D4 260
delay 100
pwo D4 240
delay 100
pwo D4 220
delay 100
pwo D4 200
delay 100
pwo D4 180
delay 100
pwo D4 160
wait


120v bulb should be at any hardware store or store that sells tools EU carries both types of bulbs just like the US last I looked otherwise ebay is always an option hrmmm I suppose I could send one if you can't figure something out as well gimme your info via PM and I'll ship you one only issues I am not sure if it is ROHS compliant will they stop shipment if it is not or will I get fined etc? Dunno don't ship much to the UK pretty strict laws over that way so dunno.

From what I noticed even is that max brightness is actually about 400 from my testing anything above that there is little or zero difference if I had lumen meter I would verify but I do not but after days of messing around this is what I found worked as I said anything above that level is just a waste in my testing nothing notable.

I have an LED bulb and a CFL bulb I could send you don't have any incandescent currently I took the last two back to the store because the light was a little on the yellow side to my liking. These are both dimmable bulbs.

Anyhow let me know what you come up with sorry man right now I just got done with all my house chores after working about 11hrs. Every day is going to be overtime for me so I may not be able to reply until it is too late sorry about that no cell phone policy at work etc... so I just wait until I get home to do any communications stuff or internet based responses once in a while I will do some at lunch or something but very rarely.

But Cicciocb is one of the developers of basic glad he chimed in and helped out! The other is mmiscool.

PS 4MB flash is for ESP12 512k flash is for ESP01 ESP07 I believe you can use 512k and it will not hurt anything but you have less to work with.

Other than that what do you think of basic pretty cool interface aye you can see this makes life a lot easier! Hope you stick around and share some video or something of some of your projects ;)

So far so good I think your example should work fine.

Thanks again for coming on over and checking us out I like a lot of your hardware concepts actually I have read about them before I knew about basic some time back when I did a couple of LUA based programs but the dimmer circuit has improved quite a bit as there has been a bit of an evolution with the dimmer board from when I read about it the first time many improvements and that is what caught my attention the most.

Anything else you need help with trackerj just let me know and I will respond as soon as I possibly can may be kind of relayed and you might have to wait until the next day if someone else does not answer by then but I'll do my best with all the long hours at my job.



Hi forlotto,

this is how is looking you testing code modified to run it on MPDMv4 AC Dimmer Board:

Code: Select alllet pinNo = 5

button "OFF" [OFF]
button "1" [1]
button "2" [2]
button "3" [3]
button "4" [4]
button "5" [5]
button "fun" [fun]
wait

[OFF]
pwo pinNo 890
wait

[1]
pwo pinNo 500
wait

[2]
pwo pinNo 600
wait

[3]
pwo pinNo 700
wait

[4]
pwo pinNo 800
wait

[5]
pwo pinNo 850
wait

[fun]
pwo pinNo 800
delay 100
pwo pinNo 700
delay 100
pwo pinNo 720
delay 100
pwo pinNo 740
delay 100
pwo pinNo 760
delay 100
pwo pinNo 780
delay 100
pwo pinNo 600
delay 100
pwo pinNo 620
delay 100
pwo pinNo 640
delay 100
pwo pinNo 660
delay 100
pwo pinNo 680
delay 100
pwo pinNo 500
delay 100
pwo pinNo 680
delay 100
pwo pinNo 660
delay 100
pwo pinNo 640
delay 100
pwo pinNo 620
delay 100
pwo pinNo 600
delay 100
pwo pinNo 880
delay 100
pwo pinNo 860
delay 100
pwo pinNo 840
delay 100
pwo pinNo 820
delay 100
pwo pinNo 800
delay 100
pwo pinNo 780
delay 100
pwo pinNo 760
wait

User avatar
By forlotto
#47253 Interesting the values are higher were there any flickers that you noticed in the lighting?