Hello all ,
I have to use the logic of reading a particular pin's status of my external µc connected with the DUE . i.e.,
- If the pin status is 1 , send data
- If the pin status is 0, do not send data.
What I want is , I have selected the pin 52 as input pin. I want it to be configured 0,initially . Onlly when I connect the external µc and the input pin status changes to 1 ,it should become 1.
I have tried:
int RDY = 52;
int RDY_STATUS=0;
pinMode(RDY, INPUT);
digitalWrite(RDY,LOW);
RDY_STATUS = digitalRead(RDY); //the values that are printed here are always one,
Serial.println(RDY_STATUS); // [b]can this never be 0 and then later changed by i/p pin to 1.[/b]
Serial.print("read pin");
Serial.println(digitalRead(RDY));
delay(1000);
if (digitalRead(RDY) == HIGH)
{
code continues
}