Hy guys!
I have a problem:
In my project, i use a simple button. When i press it, the Arduino sends thru the serial port a string.
The problem is that i don't want so send the data over and over until the button is not pressed anymore.
How can i do that?
This is my code so far:
void loop() {
  if (digitalRead(ButtonPin) == HIGH) {
   Serial.println("Pressed!");
  }
}
I tried with Serial.flush(); but it didn't work.
I also tried this:
int Val;
int Val_OLD;
void loop() {
  if (digitalRead(ButtonPin) == HIGH) {
  Â
   Val = digitalRead(ButtonPin);
  Â
   if (Val != Val_OLD) {
   Val = Val_OLD;
   Serial.println("Pressed!");
   }
  Â
  }
}
And still doesn't work!