Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By vanderbreye
#39305 Is there a way to implement a hardware PWM on the ESP-01 on any of the GPIOs?
I've seen some software timers, but i need a better performance..
I try to dim a LED-panel via transistor on one of GPIO-0/1/2, but i have ABSOLUTELY no ideas how to implement something like this via the IDE... :oops:
User avatar
By jankop
#39312 Here is primitive demo sketch for GPIO2. It is tested with LED. Anode to Vcc with resistor, katode to GPIO2.


Code: Select allvoid setup() {
  // put your setup code here, to run once:
}
void loop() {
  // put your main code here, to run repeatedly:
 for (int i=0; i < 1024; i++){
      analogWrite(2, i);
      delay(1);
   }
   for (int i=1023; i > 0; i--){
      analogWrite(2, i);
      delay(1);
   }
}
User avatar
By vanderbreye
#39354 Yeah, thank you for both answers, thats right, it would work...
But: Both solutions are softwarePWMs, which are using delays...

I THOUGHT i read about a hardwarePWM pin on the ESP-01...
http://tech.scargill.net/esp8266-pwm-on-one-output/ ?!
Sadly, I have no clue how to implement this via GPIO2 (or any other GPIO?) on the ESP-01...

if its possible to do it in the IOT_sdk, shouldn't it be possible in the Arduino as well?