I am still working on understanding how the PWM signal can be measured. I know that I should be able to see it on a scope and there are lots of example pictures of what it should look like depending on the duty cycle.
So, I was thinking that at a 100% duty cycle, I should be able to read the voltage with a VOM and on my Nodemcu board, that is what I am seeing, a voltage of 3.2v, DC.
Then if I change the duty cycle to be 50% is it accurate that the VOM would read 1.6v DC ?
I am still getting various readings so I am not sure it is my understanding, wiring or sketch.
I am trying it with a very simple sketch varying the duty cycle from 0 to 200.
This is my test sketch:
int enA = 5;
int in1 = 6;
int in2 = 7;
void setup()
pinMode(enA, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
void loop()
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
// Set speed to 200 out of possible range 0~255
analogWrite(enA, 200);