Guest User

Untitled

a guest
Oct 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. double res1=1000.0000;
  2. double res2=10000.0000;
  3. double res3=100000.0000;
  4. double res4=5000.0000;
  5. double res5=50000.0000;
  6. double res6=15000.0000;
  7. int numero;
  8.  
  9.  
  10.  
  11.  
  12. void setup()
  13. {
  14. Serial.begin(9600);
  15. }
  16.  
  17. void loop()
  18. {
  19.  
  20.  
  21.  
  22. double promedioTotal=(1/res1)+(1/res2)+(1/res3)+(1/res4)+(1/res5)+(1/res6);
  23. double ResistenciaTotal=1/promedioTotal;
  24.  
  25.  
  26. double m=analogRead(1);
  27. double voltage = m*(5/1023.0000);
  28. double resistor=660*(5-voltage)/voltage;
  29.  
  30. double PromedioResultado=1/(resistor);
  31. double ValorResFraccion=promedioTotal-PromedioResultado;
  32. int ValorFinal=(1/ValorResFraccion);
  33.  
  34. // Serial.println(" RESISTENCIA");
  35. //Serial.println(ValorFinal);
  36.  
  37. if(ValorFinal<13000)
  38. {
  39. // 1 es para 15
  40. Serial.println(" PANELES SIN NOVEDAD");
  41. }
  42.  
  43. if(ValorFinal>13000 && ValorFinal<20000)
  44. {
  45. // 1 es para 15
  46.  
  47. Serial.println("El panel Dañado es el Panel #5");
  48.  
  49.  
  50. }
  51.  
  52. if(ValorFinal>20000 && ValorFinal<80000)
  53. {
  54. // 1 es para 30
  55.  
  56. Serial.println("El panel Dañado es el Panel #6");
  57.  
  58. }
  59.  
  60.  
  61. if(ValorFinal>80000 && ValorFinal<200000)
  62. {
  63. // 1 es para 30
  64.  
  65. Serial.println("El panel Dañado es el Panel #5");
  66. }
  67.  
  68. /* Serial.print("promedio total ");
  69. Serial.print(promedioTotal,6);
  70. Serial.println(" ");
  71.  
  72. Serial.print(" RESISTENCIA GENERAL ");
  73. Serial.print(ResistenciaTotal,6);
  74. Serial.println(" ");
  75.  
  76. Serial.print(" RESISTENCIA DEL SENSOR SINTETICO ");
  77. Serial.print(resistor,6);
  78. Serial.println(" ");
  79.  
  80. Serial.print(" PROMEDIO DE LA RESISTENCIA DEL SENSOR 1/ Rr ");
  81. Serial.print(PromedioResultado,6);
  82. Serial.println(" ");
  83.  
  84. Serial.print(" VALOR DE LA RESTA RT - RC ");
  85. Serial.print(ValorResFraccion,6);
  86. Serial.println(" ");
  87.  
  88. Serial.print(" RESISTENCIA FALTANTE RELATIVA ");
  89. Serial.print(ValorFinal,6);
  90. Serial.println(" ");
  91. Serial.println(" ");
  92. */
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99. delay(500);
  100. }
Add Comment
Please, Sign In to add comment