added hr50_fonts.h

This commit is contained in:
Michael Clemens 2021-11-12 08:23:34 +01:00
parent 5fabfd6eb5
commit f3d591aed6
1 changed files with 4 additions and 4 deletions

View File

@ -3,11 +3,13 @@
#include "Arduino.h"
#include "heltec.h"
#include <ArduinoJson.h>
#include "hr50_fonts.h"
const char* ssid = "<WIFI-SSID>";
const char* password = "<WIFI-PASSWORD>";
String api_url = "http://192.168.99.193:5000/status";
int first_row = 0;
int second_row = 24;
int third_row = 48;
@ -15,13 +17,13 @@ int third_row = 48;
void setup() {
Heltec.begin(true /*DisplayEnable Enable*/, false /*LoRa Disable*/, false /*Serial Enable*/);
Heltec.display->flipScreenVertically();
Heltec.display->setFont(DialogInput_plain_16);
WiFi.begin(ssid, password);
delay(4000);
}
void printError(String err){
Heltec.display->clear();
Heltec.display->setFont(DialogInput_plain_16);
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
Heltec.display->drawString(0, second_row, err );
Heltec.display->display();
@ -62,7 +64,6 @@ void loop() {
// clear the display
Heltec.display->clear();
Heltec.display->setFont(DialogInput_plain_16);
// print left column
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
Heltec.display->drawString(0, first_row, band );
@ -80,7 +81,6 @@ void loop() {
// print a "(!)" centered in the third row
// this happens when the TRX/PA is transmitting
// or otherwise an empty response was send by the API
Heltec.display->setFont(DialogInput_plain_16);
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
Heltec.display->drawString(58, third_row, "(!)" );
Heltec.display->display();
@ -89,4 +89,4 @@ void loop() {
else {
printError("No WiFi!");
}
}
}