Difference between revisions of "Arduino 2 - sériový port, vstup"
(Created page with "<syntaxhighlight lang="c++"> void setup() { Serial.begin(9600); Serial.print("Ahoj, mas sa dobre? [a/n]: "); } void loop() { if (Serial.available()) { char c;...") |
(No difference)
|
Latest revision as of 08:19, 29 July 2019
void setup() {
Serial.begin(9600);
Serial.print("Ahoj, mas sa dobre? [a/n]: ");
}
void loop() {
if (Serial.available())
{
char c;
c = Serial.read();
if (c == 'a')
{
Serial.println("To je skevele!");
Serial.println("Dufam, ze to vydrzi");
}
else
{
Serial.println("Nevadi, zajtra bude lepsie!");
}
}
}