I had created a home electric board automation with 4 channel relay i have a couple of question around it
- When i initially read the digital pins with api , all the pins return in HIGH state ?? why ??
- 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
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?
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.”
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
Thanks for sharing Pranav, this is a vital information indeed, but i wont be using this hack at present, it will be good if this feature is there on next bolt version
Noted. We shall surely take it up in future updates.