mirror of
https://codeberg.org/mclemens/hr50-remote-display.git
synced 2024-06-16 06:15:25 +00:00
added hr50_fonts.h
This commit is contained in:
parent
5fabfd6eb5
commit
f3d591aed6
|
@ -3,11 +3,13 @@
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#include "heltec.h"
|
#include "heltec.h"
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
|
#include "hr50_fonts.h"
|
||||||
|
|
||||||
const char* ssid = "<WIFI-SSID>";
|
const char* ssid = "<WIFI-SSID>";
|
||||||
const char* password = "<WIFI-PASSWORD>";
|
const char* password = "<WIFI-PASSWORD>";
|
||||||
String api_url = "http://192.168.99.193:5000/status";
|
String api_url = "http://192.168.99.193:5000/status";
|
||||||
|
|
||||||
|
|
||||||
int first_row = 0;
|
int first_row = 0;
|
||||||
int second_row = 24;
|
int second_row = 24;
|
||||||
int third_row = 48;
|
int third_row = 48;
|
||||||
|
@ -15,13 +17,13 @@ int third_row = 48;
|
||||||
void setup() {
|
void setup() {
|
||||||
Heltec.begin(true /*DisplayEnable Enable*/, false /*LoRa Disable*/, false /*Serial Enable*/);
|
Heltec.begin(true /*DisplayEnable Enable*/, false /*LoRa Disable*/, false /*Serial Enable*/);
|
||||||
Heltec.display->flipScreenVertically();
|
Heltec.display->flipScreenVertically();
|
||||||
|
Heltec.display->setFont(DialogInput_plain_16);
|
||||||
WiFi.begin(ssid, password);
|
WiFi.begin(ssid, password);
|
||||||
delay(4000);
|
delay(4000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printError(String err){
|
void printError(String err){
|
||||||
Heltec.display->clear();
|
Heltec.display->clear();
|
||||||
Heltec.display->setFont(DialogInput_plain_16);
|
|
||||||
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
|
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
Heltec.display->drawString(0, second_row, err );
|
Heltec.display->drawString(0, second_row, err );
|
||||||
Heltec.display->display();
|
Heltec.display->display();
|
||||||
|
@ -62,7 +64,6 @@ void loop() {
|
||||||
|
|
||||||
// clear the display
|
// clear the display
|
||||||
Heltec.display->clear();
|
Heltec.display->clear();
|
||||||
Heltec.display->setFont(DialogInput_plain_16);
|
|
||||||
// print left column
|
// print left column
|
||||||
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
|
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
Heltec.display->drawString(0, first_row, band );
|
Heltec.display->drawString(0, first_row, band );
|
||||||
|
@ -80,7 +81,6 @@ void loop() {
|
||||||
// print a "(!)" centered in the third row
|
// print a "(!)" centered in the third row
|
||||||
// this happens when the TRX/PA is transmitting
|
// this happens when the TRX/PA is transmitting
|
||||||
// or otherwise an empty response was send by the API
|
// or otherwise an empty response was send by the API
|
||||||
Heltec.display->setFont(DialogInput_plain_16);
|
|
||||||
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
|
Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
Heltec.display->drawString(58, third_row, "(!)" );
|
Heltec.display->drawString(58, third_row, "(!)" );
|
||||||
Heltec.display->display();
|
Heltec.display->display();
|
||||||
|
@ -89,4 +89,4 @@ void loop() {
|
||||||
else {
|
else {
|
||||||
printError("No WiFi!");
|
printError("No WiFi!");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user