1
I would like to create a function that takes two arguments: Statuspino(nPino,Valor) However I would like, when I send only the pin number, the function read the logical pin value and when I enter the pin number WITH A VALUE, the function save the current value on the pin. Ex:
If StatusPino(Sensor1); // Se o Sensor1 tiver valor HIGH, retorna true
// Sensor Ativado
Else
// Sensor Desativado
or
StatusPino(Sensor1,LOW); // Seta o Sensor1 para LOW e retorna LOW
I found no similar function.
Yes, I could do 2 functions Lerstatuspino() and Gravarstatuspino(), but I want to avoid just this.
Thank you.