Advertisement
RuiViana

Teste_FOM

Oct 11th, 2016
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <EEPROM.h>
  2.  
  3. //unsigned int E;
  4. //unsigned int Q;
  5.  
  6.   byte adress = 0;
  7.   float E = 0.00f; ;  //Variable float to store in EEPROM.
  8.   float Q = 0.00f; ;  //Variable float
  9. //-----------------------
  10. void setup()
  11. {
  12.     EEPROM.get(adress, E);
  13.  // E = EEPROM.read(adress);    // Le a EEPROM
  14. }
  15. //-----------------------
  16. void loop()
  17. {
  18.   Q = E + 0.01;                // ????
  19. Serial.println(Q,3);
  20. Serial.println(" ");
  21. Serial.println(E,3);
  22. delay(1000);
  23.   E = analogRead(A0);
  24.   if (t.min == 60)
  25.   {
  26.      EEPROM.put(adress, E);
  27.     //EEPROM.write(adress, E);  // a cada 1h
  28.   }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement