Excuse me everyone, i have a trouble with my IoT project, i have L298n Module to control my Fan speed and Ac Light Dimmer Module(robotdyn) to control my Light Intensity in nodemcu esp8266. I cant control two modules in same time, when i set value of l298N my fan is on but the AC light Dimmer is off. please anyone help me, sorry for my bad english
The best thing you can do to help us is post the Schematic, not a frizzy drawing. Include a linked parts list and the schematic should show all connections, including power and ground. What are the power sources?
Pretty good chance that the RBDdimmer.h library uses the same timer as the software PWM on the ESP (swPWM is all it has) There aren't that many timers available on an ESP. Anyway, with a bit of help from google, yes PWM disables timer1 which is the timer being used by RBDDimmer So, even though i also want to see the schematic just to verify all is OK (it is possible that there are more causes) You have a software issue. I saw a PWM that uses timer1 specifically, but that is obviously not going to work. My suggestion is that instead of using the RBDdimmer library that uses a timer, you 'poll' for elapsed time (after the zero-cross) instead. On the other hand, this will only work fine until you start to set up something like a webserver on the same board, are you planning to do that ?
Since there really is only 2 timers on an ESP8266 i just had another idea. How about just adding a bit of code to 'void ICACHE_RAM_ATTR onTimerISR()' inside of RBDdimmer.h to take care of the PWM signal. You will be limited to the frequency used by the RBDdimmer, and you will also have to declare a variable and a function to modify it (it's not a beginners project), but it would safely resolve your issue.