Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c3c46056f |
42
0x03-conductividad/0x03-conductuvidad
Normal file
42
0x03-conductividad/0x03-conductuvidad
Normal file
@ -0,0 +1,42 @@
|
||||
|
||||
// Dispositivo
|
||||
char devIDstr[5];
|
||||
int inQuery;
|
||||
|
||||
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
|
||||
Serial.write("\n");
|
||||
delay(1000);
|
||||
|
||||
if ( Serial.available() > 0) {
|
||||
inQuery = Serial.read();
|
||||
|
||||
if ( inQuery == devID) {
|
||||
|
||||
Serial.write(itoa(devID, devIDstr, 10));
|
||||
Serial.write(" ");
|
||||
Serial.write("Tur");
|
||||
Serial.write(" ");
|
||||
|
||||
//char lecturaStr[6]; // Buffer big enough for 7-character float
|
||||
//dtostrf(getData(), 2, 4, lecturaStr); // Leave room for too large numbers!
|
||||
char lecturaStr[5]; // Buffer big enough for 7-character float
|
||||
dtostrf(getData(), 3, 2, lecturaStr); // Leave room for too large numbers!
|
||||
|
||||
Serial.write(lecturaStr);
|
||||
Serial.write(" ");
|
||||
Serial.write("TSS");
|
||||
Serial.write(" ");
|
||||
Serial.write("99");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,7 +7,7 @@ source $funciones
|
||||
test -z $nombre && exit
|
||||
test -f $public_key || exit
|
||||
|
||||
uuid="$(uuidgen)"
|
||||
uuid="$(uuid)"
|
||||
marca_de_tiempo="$(date +%s)"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user