-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only half of the display used? #16
Comments
Originally it was made for 128x128 display, and later just shown on 135x240 TTGO display, so the half remains unused. Maybe in future I'll make visualization part separated from BLE part, it would receive HUDData structure (or similar) - then it can be easier for you to make adjustments (for example, make bigger fonts to use the whole display). |
got it, thanks i tried to make those bigger but no success yet. |
Any easy way of centering the information on the TTGO (so it is not placed on left side)? |
Yes, in main file BLEHUDNaviESP32.ino, add a few lines in function
|
I just need to access the upcoming direction like turn right in 150m. I am not using an Oled display just want to print it, how can I implement that? |
@Nithesh2003 see BLEHUDNaviESP32.ino, at line 256 you can see access to text like "150m": At line 270 there is access to instruction data:
|
I am not using oled so how can i connect the esp32 module with sygic app. |
@Nithesh2003 if you have just ESP32 module without display and other hardware, it's OK, you can use this program as is (so ESP32 will actually try to send image to OLED display, but this image will be lost because you have corresponding pins unconnected as you don't have display, other parts of this program should work normally). |
Hey can i connect LEDs and get the turn signal output from esp32 to LEDs? |
Is it possible to use a lcd display? I have one with 240x280 resolution with ST7789v2 driver. Can i use TFT_eSPI library? |
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <BLE2902.h>
#include <Button2.h>
#include "IDisplay.h"
#include "ImagesOther.h"
#include "ImagesDirections.h"
#include "ImagesLanes.h"
#include "Font8x8GlyphShifter.h"
#include "DataConstants.h"
#include "VoltageMeasurement.h"
// Include the library for ST7789V2 display
#include <TFT_eSPI.h>
TFT_eSPI selectedDisplay = TFT_eSPI();
constexpr bool ENABLE_VOLTAGE_MEASUREMENT = false;
// Constants for display
#define COLOR_BLACK 0x0000
#define COLOR_WHITE 0xFFFF
#define COLOR_MAGENTA 0xF81F
// Variables for BLE
BLEServer* g_pServer = NULL;
BLECharacteristic* g_pCharIndicate = NULL;
bool g_deviceConnected = false;
uint32_t g_lastActivityTime = 0;
bool g_isNaviDataUpdated = false;
std::string g_naviData;
// Buttons
Button2 g_btnDeepSleep(TTGO_LEFT_BUTTON);
bool g_sleepRequested = false;
Button2 g_btn1(TTGO_RIGHT_BUTTON);
// Voltage measurement
#define VOLTAGE_ADC_ENABLE 14
#define VOLTAGE_ADC_PIN 34
static VoltageMeasurement g_voltage(VOLTAGE_ADC_PIN, VOLTAGE_ADC_ENABLE);
static bool g_showVoltage = false;
void setup() {
Serial.begin(115200);
Serial.println("BLENaviPeripheral2 setup() started");
selectedDisplay.init(); // Initialize the ST7789V2 display
selectedDisplay.setRotation(1); // Adjust rotation if needed
selectedDisplay.fillScreen(TFT_BLACK);
Serial.println("Display init done");
// BLE initialization
Serial.println("BLE init started");
BLEDevice::init("ESP32 HUD");
g_pServer = BLEDevice::createServer();
g_pServer->setCallbacks(new MyServerCallbacks());
BLEService *pService = g_pServer->createService(SERVICE_UUID);
// characteristic for indicate
{
uint32_t charProperties = BLECharacteristic::PROPERTY_INDICATE;
g_pCharIndicate = pService->createCharacteristic(CHAR_INDICATE_UUID, charProperties);
g_pCharIndicate->addDescriptor(new BLE2902());
g_pCharIndicate->setValue("");
}
// characteristic for write
{
uint32_t charProperties = BLECharacteristic::PROPERTY_WRITE;
BLECharacteristic *pCharWrite = pService->createCharacteristic(CHAR_WRITE_UUID, charProperties);
pCharWrite->setCallbacks(new MyCharWriteCallbacks());
}
pService->start();
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->setScanResponse(true);
pAdvertising->setMinPreferred(0x06); // functions that help with iPhone connections issue
pAdvertising->setMinPreferred(0x12);
BLEDevice::startAdvertising();
Serial.println("BLE init done");
// setup deep sleep button
g_btnDeepSleep.setLongClickTime(500);
g_btnDeepSleep.setLongClickDetectedHandler([](Button2& b) {
g_sleepRequested = true;
});
g_btnDeepSleep.setReleasedHandler([](Button2& b) {
if (!g_sleepRequested) {
return;
}
selectedDisplay.sleep();
// without this the module won't wake up with button if powered from battery,
// especially if entered deep sleep when powered from USB
g_voltage.end();
esp_sleep_enable_ext0_wakeup(GPIO_NUM_WAKEUP, 0);
delay(200);
esp_deep_sleep_start();
});
// setup voltage measurement
if (ENABLE_VOLTAGE_MEASUREMENT) {
g_voltage.begin();
g_btn1.setPressedHandler([](Button2& b) {
g_showVoltage = true;
});
g_btn1.setReleasedHandler([](Button2& b) {
g_showVoltage = false;
});
}
Serial.println("setup() finished");
}
void loop() {
g_btnDeepSleep.loop();
g_btn1.loop();
if (g_sleepRequested) {
// Handle sleep
}
else if (g_showVoltage) {
// Handle voltage display
}
else if (g_deviceConnected) {
// Handle device connected state
}
else if (millis() > 3000) {
// Handle disconnected state
}
delay(10);
} |
ii feels like a waste of space on such a small display. are there any other information that will be displayed on the other half?
The text was updated successfully, but these errors were encountered: