int pinA = 11;
int pinB = 12;
int val;
void setup()
{
pinMode(pinA, OUTPUT);
pinMode(pinB, INPUT);
}
void loop()
{
int();
}
void int()
{
val=digitalRead(pinB); // read data
if(pinB == HIGH)
{
Serial.println("PINA ON"); //write serially
}
else if(pinB == LOW)
{
Serial.println("PinA OFF"); //write serially
}
}
the message is keep repeating. how to stop the message in serial monitor even the pin is still in continuous active high or low status. it's just a one time message.