4 channel Relay doubt


#1

Hi Team,
I had created a home electric board automation with 4 channel relay i have a couple of question around it

  1. When i initially read the digital pins with api , all the pins return in HIGH state ?? why ??
  2. When i change the state using digitalwrite api( and its successful) and then try to read again , the read api reset the pins to again in HIGH state , why ??

Please help me resolve this issue


#2

The digital read and write functions work independently. When you run digital read function it sets the pins in Input mode. When you run the write it sets it to output mode.

If you want to measure a value at a pin, set that pin as high or low and then connect the output of that pin to another pin on Bolt and use that another pin to read the value.

May I know the reason why you wish to run this experiment?


#3

I am trying to build an automated electric board and with relay i want to manage multiple electrical appliances , i had made an mobile app which does all that for me but i need to know the current state of the pins to show the user the current state of there appliances

can u please elaborate your comment

“If you want to measure a value at a pin, set that pin as high or low and then connect the output of that pin to another pin on Bolt and use that another pin to read the value.”


#4

Here is a video on how to mesure the state of a pin set at digital write: https://drive.google.com/file/d/1nV8LPtvPPL9Y8wSkgHNUdZUL_9f5SHVb/preview