Today I will tell you how to generate an analog signal using ESP 8 to 66.
In ESP 8266 there is no analog output port.
We just generate analog signal using digital pin.
We just create a PWM signal over here.
By changing the width of the pulse we just create an analog signal.
For that purpose we just go to Blink Console over here in the developer zone create new template.
I just name it analog write.
Analog write.
I am using ESP 8266 right now.
My connection type is Wi-Fi.
Click.
Over.
Done.
Now create a data stream.
Go to the data stream using virtual Pin.
So right now over here I just put analog read not analog read analog write.
I'm using the zero pin.
Inside this.
The minimum value is zero and maximum value is 255 because there is a eight bit DSA.
So now my data stream is created.
Go to the web dashboard.
Over here you just drag the slider inside this.
Select the data stream V0 over here.
Now just save it.
Increase the size.
Save this.
Go to the device.
Create new device from template Analogwrite.
Create.
Now this is my code.
Or you can say my API key.
Click over here.
Go to the code.
Just copy and paste over here.
Now as you see my template ID is.
This template name is Analogwrite.
My authentication ID is this.
This is my same code.
My wifi ID password is same.
I'm using virtual pin zero.
So over here this is my code.
The value is my variable.
It comes as a integer through the parameter as an integer.
Right now I'm using command analogwrite.
I'm writing over pin number five and the pin number five.
Inside the ESP 8266 is the one I just connect D one to my LED.
So I am just changing the brightness using my slider.
So over here I just put the value.
Value may be from 0 to 255.
So over here this is my void setup Serial.begin 1150 200.
This is my baud rate.
I just use blink app also.
Pinmode.
Right now over here is output as the output five as the output five is my D1 pin.
So in the loop I just blink dot run.
So upload this code inside the ESp8266.
It will take some time.
After uploading the code we just go to the hardware part.
So now it is writing.
So we just move to the hardware.
Right now I am just resetting it.
Hard reset.
So over here this red pin is connected to D1 pin because its Gpio number is five.
That I provide inside the code.
This is my ground.
My LED is connected over here.
So now just move to the dashboard.
Blink console.
Dashboard.
Go to the devices.
My device is online.
Go to analog.
Right.
So I just increase the slider.
As you see the brightness comes from the LED right now.
You just increase the brightness using this.
So now I am just decreasing the brightness.
You just check over the LED and steps.
Okay.
So now this is from the dashboard.
Now we just move to the mobile app.
So over here I just go to the blink console.
link app over here.
This is my analog, right?
Is there?
Go to the gearbox add new device.
That is my slider.
I just drag this over here, select the data stream, use the data stream.
Now I just move.
Just back.
Now I just increase as you see brightness.
Right now just change the brightness.
So this is how you can change or generate analog signal using ESP 8266.
So this is all about today's lecture.
Thank you.