27-12-2019, 15:47
Witam chce mój problem polega na tym ze chce wysyłać tekst pin2 i pin3 inny tekst w programie poniżej tekst jest wysyłany ale raz ten a raz drugi a ja chce np. x raz naciśnięty pin2 x wysłany tekst i analogicznie pin 3 co mam zmienić w moim kodzie
void setup() {
// put your setup code here, to run once:
pinMode(3, INPUT_PULLUP);
pinMode(2,INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(3)==LOW);
else
Serial.println("SIEMA");
while(digitalRead(3)==HIGH);
delay(25);
if(digitalRead(2)==LOW);
else
Serial.println("ELO");
while(digitalRead(2)==HIGH);
delay(25);
}
void setup() {
// put your setup code here, to run once:
pinMode(3, INPUT_PULLUP);
pinMode(2,INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(3)==LOW);
else
Serial.println("SIEMA");
while(digitalRead(3)==HIGH);
delay(25);
if(digitalRead(2)==LOW);
else
Serial.println("ELO");
while(digitalRead(2)==HIGH);
delay(25);
}