I have an ethernet shield connected to my uno. My goal is to print out the real time binary state (1 or 0) of my arduino pins 10~13, every time there's a change in state ie any time there's communication going on.
...but it doesn't work, please help! thanks in advance ![]()
void setup()
{
//(connection already made)
for(int i=10; i<=13 ;i++)
{
pinMode(i,INPUT);
}
Serial.println();
////////////////////////////////////////////////////
}
void loop()
{
int j=0, hi, by;
for(int i=10; i<=13 ;i++)
{
hi = digitalRead(i);
if(j==0)
{by=hi;}
if(hi!=by && j>0)
{
Serial.print(i);
Serial.print(": ");
Serial.println(hi);
Serial.println("\n");
}
}
j++;
by = hi;
}
i was hoping for Serial output to print like crazy when i pinged or telnetted into the ethernet shield; i can telnet into it, but nothing prints on the serial output.