Arduinos
This commit is contained in:
parent
c70f99bb5b
commit
998288fabc
2 changed files with 67 additions and 0 deletions
38
arduino_0x01-temp/arduino_0x01.ino
Normal file
38
arduino_0x01-temp/arduino_0x01.ino
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
29
arduino_0x01-temp/arduino_0x01.ino.bak
Executable file
29
arduino_0x01-temp/arduino_0x01.ino.bak
Executable 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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue