General area when it fits no where else

Moderator: Mmiscool

User avatar
By Roshan
#70404 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
User avatar
By Electroguard
#70413 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.