2024-11-15 21:28:39 +01:00
|
|
|
/*
|
|
|
|
This is part of RadiationMapping
|
|
|
|
Copyright (C) 2024 Václav Šmejkal
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "display.hpp"
|
|
|
|
|
|
|
|
#include <Wire.h>
|
|
|
|
#include <LiquidCrystal_I2C.h>
|
|
|
|
|
|
|
|
LiquidCrystal_I2C lcd(0x27, 2, 16);
|
|
|
|
|
|
|
|
namespace display
|
|
|
|
{
|
|
|
|
void begin(void)
|
|
|
|
{
|
|
|
|
//INIT THE LCD ITSELF
|
|
|
|
Wire.begin(6, 7);
|
|
|
|
lcd.init();
|
|
|
|
|
|
|
|
//TURN ON THE BACKLIGHT
|
|
|
|
lcd.backlight();
|
|
|
|
}
|
|
|
|
|
2025-01-01 14:11:06 +01:00
|
|
|
void print(String line_1, String line_2)
|
2024-11-15 21:28:39 +01:00
|
|
|
{
|
|
|
|
//CLEAR
|
|
|
|
lcd.clear();
|
|
|
|
|
|
|
|
//LINE 1
|
|
|
|
lcd.setCursor(0, 0);
|
|
|
|
lcd.print(line_1);
|
|
|
|
|
|
|
|
//LINE 2
|
|
|
|
if (line_2 != NULL)
|
|
|
|
{
|
|
|
|
lcd.setCursor(0, 1);
|
|
|
|
lcd.print(line_2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|