Toaster.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //////////////////////////////////////////////////////////////////////
  2. // //
  3. // Programmname: <Bitte einen treffenden Namen> //
  4. // Datum: TT.MM.JJJJ //
  5. // Beschreibung: <Kurze Beschreibung des Programms> //
  6. // //
  7. // 1. Autor: Vorname Name, Matrikel, Matrikel-Nr. //
  8. // 2. Autor: Vorname Name, Matrikel, Matrikel-Nr. //
  9. // //
  10. //////////////////////////////////////////////////////////////////////
  11. ////////// Inkludierte Header-Dateien //////////
  12. #include "Toaster.h"
  13. ////////// Globale Variablen //////////
  14. DS18B20 Tempsensor = DS18B20(TEMPSENSOR_PIN);
  15. LiquidCrystal Display = LiquidCrystal(13, 12, 10, 9, 8, 7);
  16. ////////// Setup-Funktion //////////
  17. void setup(void) { // put your setup code here, to run once:
  18. ////////// Lokale Variablen //////////
  19. ////////// GPIO Setup //////////
  20. Serial.begin(BAUDRATE);
  21. Display.begin(16,2);
  22. ////////// Einmalige Anweisungen //////////
  23. }
  24. ////////// Loop-Funktion //////////
  25. void loop(void) { // put your main code here, to run repeatedly:
  26. ////////// Lokale Variablen //////////
  27. ////////// Hauptprogramm //////////
  28. }
  29. ////////// Unterfunktionen / ISR //////////
  30. void lcd(float temp_in_c, int tact_in_s, int tmax_in_s) {
  31. Display.setCursor(0, 0);
  32. Display.print("Temp=");
  33. Display.print(temp_in_c);
  34. Display.print("*C ");
  35. Display.setCursor(0, 1);
  36. Display.print("t=");
  37. Display.print(tact_in_s);
  38. Display.print("s");
  39. Display.print(" tmax=");
  40. Display.print(tmax_in_s);
  41. Display.print("s");
  42. }
  43. float get_temp(void) {
  44. return Tempsensor.getTempC();
  45. }