I work with Arduino DUE. I would like to configure few of my digital pins as INPUT pins. When the µc sets these particular 4 pins , the DUE must be activated. Something like a DATAREADY pin in the SPI,where the data will be sent to the slave only,when it sets the pin to 1.
According to the datasheet , the external µC would set the pin state from 0 to 1. I tried this program for experimenting the effect of digital pins,
int RDY = 52;
void setup() {
Serial.begin(9600);
pinMode(RDY,INPUT_PULLUP);
pinMode(50,INPUT);
digitalWrite(RDY,HIGH);
}
void loop() {
digitalRead(RDY);
digitalRead(50);
digitalRead(11);
digitalRead(12);
Serial.println(digitalRead(RDY));
Serial.println(digitalRead(50));
Serial.println(digitalRead(11));
Serial.println(digitalRead(12));
delay(100);
}
Results obtained are; 1,1,0,0 as expected. I cannot find a proper way to detect the change of state of the pin (from 0 to 1). To make detect changes, I connected/disconnected the 5V output pin of DUE to the particular digital pins. The results never changed with connection and disconnection of the 5V wire for any pin.
Is there any possible way to detect the change of the pin state as in INPUT mode in Arduino DUE? Most examples are dealing with switches,but in my case I need a pin as a input.
Thanks
I connected/disconnected the 5V... your experimentation lacks some steps.logic 1(+5V), why did you not apply alogic 0(gnd)? .... if you were a biologist that is studying how frogs react to coloured light, would you use blue light only?pinMode(50,INPUT); digitalWrite(RDY,HIGH);with this I triedpinMode(50,INPUT); digitalWrite(RDY,LOW);Then later I realised ,that Input will always only stay high(becoz of oull-ups) , as writing LOW on the input is not affected. I realised I had messed it !