I've a problem, and I don't know how I can do to a button print a message that I write. how can I program that?
tengo un proble y es que no se como hacer que un boton me imprima un mensaje, como puedo hacer para que un boton me imprima un mensaje en especifico?
its not to hard here is some code for you to use as an example
open serial monitor (make sure its set to 9600 baud)
int button = 3 ;//the pin with your button
void setup() {
pinMode(button,INPUT_PULLUP); //set the pin to input
Serial.begin(9600);
Serial.println("system ready");
Serial.println(" ");
}
void loop() {
//wait for button to be pressed then display text
if (digitalRead(button) == 0) {
delay(100);//wait a little
Serial.println("what you want to print"); //put your words here
}
}
ie Your code and any error messages should always be placed between code tags. Posting it inline as you have done makes it much harder to read or copy and paste for diagnosis.
It's still not too late to edit your post and do this.
You can also create code tags manually as shown here:-