Advertisement
Guest User

Untitled

a guest
Sep 16th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Arduino.h>
  2. #include "czujnik.h"
  3.  
  4.  
  5. BME czujnik;
  6.  
  7.  
  8. void setup()
  9. {
  10.     Serial.begin(9600);
  11.     czujnik.config();
  12. }
  13.  
  14. void loop()
  15. {
  16.     float temperatura = 0;
  17.     czujnik.odczyt();
  18.     temperatura = czujnik.temperatura();
  19.     Serial.print("1. "); Serial.println(temperatura);
  20.     delay(1000);
  21. }
  22.  
  23.  
  24. /*
  25. *Plik: czujnik.h
  26. */
  27. #include <Arduino.h>
  28.  
  29. #ifndef CZUJNIK_H
  30. #define CZUJNIK_H
  31.  
  32.  
  33. class BME
  34. {
  35.     public:
  36.     void config();
  37.     void odczyt();
  38.     float temperatura;
  39. };
  40. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement