29 lines
526 B
Arduino
Executable file
29 lines
526 B
Arduino
Executable file
int inData;
|
|
|
|
void setup() {
|
|
Serial.begin(14400);
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
if ( Serial.available() > 0) {
|
|
inData = Serial.read();
|
|
switch (inData) {
|
|
case 0x01:
|
|
Serial.write("id:temperatura");
|
|
Serial.write(" ");
|
|
Serial.write("tp:temp");
|
|
Serial.write(" ");
|
|
Serial.write("vl:29");
|
|
Serial.write(" ");
|
|
Serial.write("un:C");
|
|
Serial.write(" ");
|
|
Serial.write("er:99");
|
|
Serial.write(" ");
|
|
Serial.write('\n');
|
|
break;
|
|
}
|
|
}
|
|
}
|