Merge branch 'master' of 192.168.1.250:/home/git/AHome into master
This commit is contained in:
@@ -51,6 +51,7 @@ void setup() {
|
|||||||
sendData(msgTemp, temp_out, 1);
|
sendData(msgTemp, temp_out, 1);
|
||||||
sendData(msgHum, hum_out, 1);
|
sendData(msgHum, hum_out, 1);
|
||||||
unsigned long battMV = hwCPUVoltage();
|
unsigned long battMV = hwCPUVoltage();
|
||||||
|
v_out = battMV / 1000.0;
|
||||||
sendData(msgVolts, battMV / 1000.0, 2);
|
sendData(msgVolts, battMV / 1000.0, 2);
|
||||||
cRun = 0;
|
cRun = 0;
|
||||||
sendData(msgMillis, cRun);
|
sendData(msgMillis, cRun);
|
||||||
@@ -75,7 +76,7 @@ void loop() {
|
|||||||
// send(msgHum.set(hum, 1));
|
// send(msgHum.set(hum, 1));
|
||||||
}
|
}
|
||||||
unsigned long battMV = hwCPUVoltage();
|
unsigned long battMV = hwCPUVoltage();
|
||||||
v_out += (battMV / 1000.0 - v_out) * 0.1;
|
v_out += ((battMV / 1000.0) - v_out) * 0.1;
|
||||||
//sensorValue = analogRead(BATTERY_SENSE_PIN);
|
//sensorValue = analogRead(BATTERY_SENSE_PIN);
|
||||||
//v = sensorValue * 0.004659498;
|
//v = sensorValue * 0.004659498;
|
||||||
//batteryPcnt = ((v-3.0) * 100) / 1.2;
|
//batteryPcnt = ((v-3.0) * 100) / 1.2;
|
||||||
@@ -107,14 +108,14 @@ void sendData(MyMessage msg, bool status)
|
|||||||
uint8_t count = 0;
|
uint8_t count = 0;
|
||||||
while(send_data == false){
|
while(send_data == false){
|
||||||
count++;
|
count++;
|
||||||
Serial.print(millis());
|
//Serial.print(millis());
|
||||||
Serial.println(" send before");
|
//Serial.println(" send before");
|
||||||
send_data = send(msg.set(status));
|
send_data = send(msg.set(status));
|
||||||
Serial.print(millis());
|
//Serial.print(millis());
|
||||||
Serial.println(" send after");
|
//Serial.println(" send after");
|
||||||
wait(1000, C_SET, msg.type);
|
wait(1000, C_SET, msg.type);
|
||||||
Serial.print(millis());
|
//Serial.print(millis());
|
||||||
Serial.println(" wait comlete");
|
//Serial.println(" wait comlete");
|
||||||
if ((count == 3 )&&(send_data == 0)){ // Если сделано 3 попытки и нет подтверждения отправки
|
if ((count == 3 )&&(send_data == 0)){ // Если сделано 3 попытки и нет подтверждения отправки
|
||||||
count = 0; // Обнуляем счётчик
|
count = 0; // Обнуляем счётчик
|
||||||
send_data = 1; // Выходим из цикла
|
send_data = 1; // Выходим из цикла
|
||||||
@@ -127,11 +128,11 @@ void sendData(MyMessage msg, float status, uint8_t decm)
|
|||||||
uint8_t count = 0;
|
uint8_t count = 0;
|
||||||
while(send_data == false){
|
while(send_data == false){
|
||||||
count++;
|
count++;
|
||||||
Serial.print(millis());
|
//Serial.print(millis());
|
||||||
Serial.println(" send before");
|
//Serial.println(" send before");
|
||||||
send_data = send(msg.set(status, decm));
|
send_data = send(msg.set(status, decm));
|
||||||
Serial.print(millis());
|
//Serial.print(millis());
|
||||||
Serial.println(" send after");
|
//Serial.println(" send after");
|
||||||
if(!send_data){
|
if(!send_data){
|
||||||
wait(50, C_SET, msg.type);
|
wait(50, C_SET, msg.type);
|
||||||
Serial.print(millis());
|
Serial.print(millis());
|
||||||
@@ -167,8 +168,8 @@ void sendData(MyMessage msg, uint32_t status)
|
|||||||
send_data = send(msg.set(status));
|
send_data = send(msg.set(status));
|
||||||
if(!send_data){
|
if(!send_data){
|
||||||
wait(50, C_SET, msg.type);
|
wait(50, C_SET, msg.type);
|
||||||
Serial.print(millis());
|
//Serial.print(millis());
|
||||||
Serial.println(" wait comlete");
|
//Serial.println(" wait comlete");
|
||||||
}
|
}
|
||||||
if ((count == 3 )&&(send_data == 0)){ // Если сделано 3 попытки и нет подтверждения отправки
|
if ((count == 3 )&&(send_data == 0)){ // Если сделано 3 попытки и нет подтверждения отправки
|
||||||
count = 0; // Обнуляем счётчик
|
count = 0; // Обнуляем счётчик
|
||||||
|
|||||||
Reference in New Issue
Block a user