This commit is contained in:
Sergio Pernas 2022-03-23 16:11:54 -03:00
parent c70f99bb5b
commit 998288fabc
2 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,38 @@
int inData;
const char* valueSensor;
void setup() {
Serial.begin(14400);
}
void loop() {
if ( Serial.available() > 0) {
inData = Serial.read();
switch (inData) {
case 0x01:
Serial.write("0x01");
Serial.write(" ");
Serial.write("hum");
Serial.write(" ");
Serial.write("78");
Serial.write(" ");
Serial.write("P");
Serial.write(" ");
Serial.write("99");
Serial.write(" ");
Serial.write("pre");
Serial.write(" ");
Serial.write("100");
Serial.write(" ");
Serial.write("Hpa");
Serial.write(" ");
Serial.write("98");
Serial.write(" ");
break;
}
}
}

View file

@ -0,0 +1,29 @@
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;
}
}
}