Arduino 2 - sériový port, vstup B

From DT^2
Revision as of 14:29, 29 July 2019 by Palo (talk | contribs) (Created page with "<syntaxhighlight lang="C++"> void setup() { Serial.begin(9600); Serial.println("Ahoj, mas sa dobre? [a/n]:"); } void loop() { if (Serial.available()) { char c;...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
void setup() {
  Serial.begin(9600);
  Serial.println("Ahoj, mas sa dobre? [a/n]:");
}

void loop() {
  if (Serial.available())
  {
     char c;
     c = Serial.read();
     if (c == 'a') 
       Serial.println("To je vyborne!");
     else
       Serial.println("Nevadi. Usmievaj sa aj tak.");
  }
}