Browse Source

Sende senden nun eine fortlaufende Nummer zusammen mit ihrer ID

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
nano-revision-1.0
Stephan Richter 1 year ago
parent
commit
6acec63e08
  1. 9
      Sender/Sender.ino

9
Sender/Sender.ino

@ -8,7 +8,7 @@ int id = 0; @@ -8,7 +8,7 @@ int id = 0;
int baud = 19200;
int enable = 2;
char c;
int counter = 0;
void setup(){
pinMode(A0,INPUT);
id = analogRead(A0)*10;
@ -32,9 +32,12 @@ void loop(){ @@ -32,9 +32,12 @@ void loop(){
printSerial();
delay(id);
digitalWrite(enable,HIGH);
mySerial.write("Howdy, this is Arduino #");
mySerial.println(id);
mySerial.print("Arduino #");
mySerial.print(id);
mySerial.print(": Counter = ");
mySerial.println(counter);
mySerial.flush();
digitalWrite(enable,LOW);
printSerial();
counter++;
}

Loading…
Cancel
Save