-->
Page 1 of 1

About input & output mode

PostPosted: Thu Sep 28, 2017 8:58 am
by Roshan
Hi !
I want to know if we want to use any pin as input or output then we have to change their mode as you see in arduino.

pinMode(led,OUTPUT);
pinMode(sw,INPUT);

but when we using basic with esp8266 then what we have to do ?

is esp8266 automatically change their pin behavior according to function ?

Thanks

Roshan

Re: About input & output mode

PostPosted: Thu Sep 28, 2017 10:01 am
by Electroguard
The difference between using the pin for input or output is set using the first parameter in the brackets of the IO() command ... PO sets the Pin for Output, PI sets the pin for Input.

IO(PO,{PIN},{VALUE}):

po allows you to set pin on the esp high or low (WRITE)



IO(PI,{PIN}):

Will place the high or low status of a pin into the variable chose (READ)

Useful for reading push buttons and other electronic inputs.

Re: About input & output mode

PostPosted: Fri Sep 29, 2017 2:37 am
by Roshan
Thanks

now it is clear.