Sende senden nun eine fortlaufende Nummer zusammen mit ihrer ID
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -8,7 +8,7 @@ int id = 0;
|
|||||||
int baud = 19200;
|
int baud = 19200;
|
||||||
int enable = 2;
|
int enable = 2;
|
||||||
char c;
|
char c;
|
||||||
|
int counter = 0;
|
||||||
void setup(){
|
void setup(){
|
||||||
pinMode(A0,INPUT);
|
pinMode(A0,INPUT);
|
||||||
id = analogRead(A0)*10;
|
id = analogRead(A0)*10;
|
||||||
@@ -32,9 +32,12 @@ void loop(){
|
|||||||
printSerial();
|
printSerial();
|
||||||
delay(id);
|
delay(id);
|
||||||
digitalWrite(enable,HIGH);
|
digitalWrite(enable,HIGH);
|
||||||
mySerial.write("Howdy, this is Arduino #");
|
mySerial.print("Arduino #");
|
||||||
mySerial.println(id);
|
mySerial.print(id);
|
||||||
|
mySerial.print(": Counter = ");
|
||||||
|
mySerial.println(counter);
|
||||||
mySerial.flush();
|
mySerial.flush();
|
||||||
digitalWrite(enable,LOW);
|
digitalWrite(enable,LOW);
|
||||||
printSerial();
|
printSerial();
|
||||||
|
counter++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user