Se eliminan carpetas no relacionadas al codigo
|
|
@ -10,9 +10,6 @@ This is an ESP32 OBD2 Gauge for vehicles that are compatible with OBD2
|
|||
- Prototype https://youtu.be/PkQaUJbzTNM
|
||||
- Current Model Short Demo https://youtu.be/vvBIeim7XTE
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Software:
|
||||
- Arduino IDE 2.3.2 + ESP32 arduino core 2.0.17
|
||||
|
|
|
|||
BIN
SDCard/mypic.jpg
|
Before Width: | Height: | Size: 35 KiB |
|
|
@ -81,6 +81,47 @@ class SPPProfile(dbus.service.Object):
|
|||
print(f"[BlueZ] RequestDisconnection from {path}")
|
||||
|
||||
|
||||
class AutoAgent(dbus.service.Object):
|
||||
"""BlueZ Agent that automatically accepts pairing and SPP authorization"""
|
||||
@dbus.service.method("org.bluez.Agent1", in_signature="", out_signature="")
|
||||
def Release(self):
|
||||
pass
|
||||
|
||||
@dbus.service.method("org.bluez.Agent1", in_signature="os", out_signature="")
|
||||
def AuthorizeService(self, device, uuid):
|
||||
print(f"\n[BlueZ Agent] Conexión de servicio autorizada para {device}")
|
||||
return
|
||||
|
||||
@dbus.service.method("org.bluez.Agent1", in_signature="o", out_signature="s")
|
||||
def RequestPinCode(self, device):
|
||||
print(f"\n[BlueZ Agent] PIN solicitado para {device} -> 1234")
|
||||
return "1234"
|
||||
|
||||
@dbus.service.method("org.bluez.Agent1", in_signature="o", out_signature="u")
|
||||
def RequestPasskey(self, device):
|
||||
return dbus.UInt32(0)
|
||||
|
||||
@dbus.service.method("org.bluez.Agent1", in_signature="ouq", out_signature="")
|
||||
def DisplayPasskey(self, device, passkey, entered):
|
||||
pass
|
||||
|
||||
@dbus.service.method("org.bluez.Agent1", in_signature="os", out_signature="")
|
||||
def DisplayPinCode(self, device, pincode):
|
||||
pass
|
||||
|
||||
@dbus.service.method("org.bluez.Agent1", in_signature="ou", out_signature="")
|
||||
def RequestConfirmation(self, device, passkey):
|
||||
return
|
||||
|
||||
@dbus.service.method("org.bluez.Agent1", in_signature="o", out_signature="")
|
||||
def RequestAuthorization(self, device):
|
||||
return
|
||||
|
||||
@dbus.service.method("org.bluez.Agent1", in_signature="", out_signature="")
|
||||
def Cancel(self):
|
||||
pass
|
||||
|
||||
|
||||
def format_elm_response(cmd: str) -> str:
|
||||
"""Computes the ELM327 response string for a given command"""
|
||||
cmd = cmd.strip().upper()
|
||||
|
|
@ -292,6 +333,37 @@ def run_emulator():
|
|||
except Exception as e:
|
||||
print(f"[BlueZ] Aviso al registrar perfil SPP: {e}")
|
||||
|
||||
# Register BlueZ Agent for auto-pairing and authorization
|
||||
agent_path = "/org/bluez/obd2_agent"
|
||||
agent = AutoAgent(bus, agent_path)
|
||||
agent_manager = None
|
||||
try:
|
||||
agent_manager = dbus.Interface(
|
||||
bus.get_object("org.bluez", "/org/bluez"),
|
||||
"org.bluez.AgentManager1"
|
||||
)
|
||||
agent_manager.RegisterAgent(agent_path, "NoInputNoOutput")
|
||||
agent_manager.RequestDefaultAgent(agent_path)
|
||||
print("[BlueZ] Agente de autenticación y emparejamiento registrado.")
|
||||
except Exception as e:
|
||||
print(f"[BlueZ] Aviso al registrar agente: {e}")
|
||||
|
||||
# Configure adapter properties (Discoverable, Pairable, Alias)
|
||||
try:
|
||||
manager = dbus.Interface(bus.get_object("org.bluez", "/"), "org.freedesktop.DBus.ObjectManager")
|
||||
objects = manager.GetManagedObjects()
|
||||
for path, ifaces in objects.items():
|
||||
if "org.bluez.Adapter1" in ifaces:
|
||||
props = dbus.Interface(bus.get_object("org.bluez", path), "org.freedesktop.DBus.Properties")
|
||||
props.Set("org.bluez.Adapter1", "Alias", dbus.String("OBDII"))
|
||||
props.Set("org.bluez.Adapter1", "DiscoverableTimeout", dbus.UInt32(0))
|
||||
props.Set("org.bluez.Adapter1", "Discoverable", dbus.Boolean(True))
|
||||
props.Set("org.bluez.Adapter1", "Pairable", dbus.Boolean(True))
|
||||
print(f"[BlueZ] Adaptador configurado en {path} (Nombre: OBDII, Visible y Emparejable).")
|
||||
break
|
||||
except Exception as e:
|
||||
print(f"[BlueZ] Aviso al configurar adaptador: {e}")
|
||||
|
||||
# Start GLib main loop in background thread for D-Bus signals and methods
|
||||
glib_loop = GLib.MainLoop()
|
||||
dbus_thread = threading.Thread(target=glib_loop.run, daemon=True)
|
||||
|
|
@ -326,6 +398,11 @@ def run_emulator():
|
|||
profile_manager.UnregisterProfile(profile_path)
|
||||
except Exception:
|
||||
pass
|
||||
if agent_manager:
|
||||
try:
|
||||
agent_manager.UnregisterAgent(agent_path)
|
||||
except Exception:
|
||||
pass
|
||||
server_sock.close()
|
||||
print("Emulador finalizado.")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
#
|
||||
## Alias OBJ Material File
|
||||
# Exported from SketchUp, (c) 2000-2012 Trimble Navigation Limited
|
||||
|
||||
newmtl M_0134_DimGray
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 0.411765 0.411765 0.411765
|
||||
Ks 0.330000 0.330000 0.330000
|
||||
|
||||
newmtl FrontColor
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 1.000000 1.000000 1.000000
|
||||
Ks 0.330000 0.330000 0.330000
|
||||
|
||||
|
Before Width: | Height: | Size: 100 KiB |
|
|
@ -1,3 +0,0 @@
|
|||
3d print files
|
||||
|
||||

|
||||
|
Before Width: | Height: | Size: 24 KiB |
BIN
hardware/Box.png
|
Before Width: | Height: | Size: 871 KiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 715 KiB |
|
Before Width: | Height: | Size: 720 KiB |
|
Before Width: | Height: | Size: 302 KiB |
|
|
@ -1,14 +0,0 @@
|
|||
ESP32 Arduino LVGL WIFI&Bluetooth Development Board 2.8" 240*320 Smart Display Screen 2.8inch LCD TFT Module With Touch WROOM
|
||||
https://s.click.aliexpress.com/e/_DB8Ht8N
|
||||
|
||||
Micro USB Output 12V to 5V 3A
|
||||
https://shopee.co.th/%E2%98%80S%E2%98%80%E0%B8%AD%E0%B8%B8%E0%B8%9B%E0%B8%81%E0%B8%A3%E0%B8%93%E0%B9%8C%E0%B9%81%E0%B8%9B%E0%B8%A5%E0%B8%87%E0%B8%9E%E0%B8%B2%E0%B8%A7%E0%B9%80%E0%B8%A7%E0%B8%AD%E0%B8%A3%E0%B9%8C%E0%B8%8B%E0%B8%B1%E0%B8%9E%E0%B8%9E%E0%B8%A5%E0%B8%B2%E0%B8%A2-Micro-USB-Output-12V-to-5V-3A-%E0%B8%AA%E0%B9%8D%E0%B8%B2%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A-PDA-DV-i.293684420.7945781904?sp_atk=8f247e46-d3d4-4ec1-abec-2bd83ef709de&xptdk=8f247e46-d3d4-4ec1-abec-2bd83ef709de
|
||||
|
||||
ELM327 Bluetooth
|
||||
https://s.click.aliexpress.com/e/_oo3THvG
|
||||
|
||||
Speaker 1W 8R 2809 8ohm
|
||||
https://shopee.co.th/(Takashitree)-%E0%B8%A5%E0%B9%8D%E0%B8%B2%E0%B9%82%E0%B8%9E%E0%B8%87%E0%B8%AE%E0%B8%AD%E0%B8%A3%E0%B9%8C%E0%B8%99%E0%B8%84%E0%B8%AD%E0%B8%A1%E0%B8%9E%E0%B8%B4%E0%B8%A7%E0%B9%80%E0%B8%95%E0%B8%AD%E0%B8%A3%E0%B9%8C-%E0%B9%82%E0%B8%99%E0%B9%89%E0%B8%95%E0%B8%9A%E0%B8%B8%E0%B9%8A%E0%B8%81-1W-8R-2809-8-%E0%B9%82%E0%B8%AD%E0%B8%AB%E0%B9%8C%E0%B8%A1-28*9-%E0%B8%A1%E0%B8%A1.-2-%E0%B8%8A%E0%B8%B4%E0%B9%89%E0%B8%99-i.131626048.22227074892
|
||||
|
||||
Push button
|
||||
Push Bottom Switch 6x6x5 mm
|
||||
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 12 KiB |
BIN
icon/about.jpg
|
Before Width: | Height: | Size: 4 KiB |
BIN
icon/arc.jpg
|
Before Width: | Height: | Size: 2.8 KiB |
BIN
icon/autooff.jpg
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
BIN
icon/cpu.jpg
|
Before Width: | Height: | Size: 4 KiB |
BIN
icon/engine.jpg
|
Before Width: | Height: | Size: 2.3 KiB |
BIN
icon/image.jpg
|
Before Width: | Height: | Size: 4 KiB |
BIN
icon/mypic.jpg
|
Before Width: | Height: | Size: 26 KiB |
BIN
icon/nofile.jpg
|
Before Width: | Height: | Size: 5.7 KiB |
BIN
icon/number.jpg
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
BIN
icon/quit.jpg
|
Before Width: | Height: | Size: 4 KiB |
BIN
icon/sdcard.png
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1,022 B |
|
Before Width: | Height: | Size: 982 B |
|
Before Width: | Height: | Size: 16 KiB |
BIN
icon/vbar.jpg
|
Before Width: | Height: | Size: 3.6 KiB |
BIN
icon/warning.jpg
|
Before Width: | Height: | Size: 1.2 KiB |
BIN
icon/wifi.jpg
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 208 KiB |
|
Before Width: | Height: | Size: 228 KiB |
|
Before Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 755 KiB |
BIN
picture/page.jpg
|
Before Width: | Height: | Size: 956 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
|
@ -1,6 +1,3 @@
|
|||
// DSEG7 Modern BoldItalic 24pt strictly-monospaced smooth font
|
||||
#include <pgmspace.h>
|
||||
|
||||
const uint8_t DSEG7_Modern_BoldItalic_24[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x18,
|
||||
|
|
@ -333,9 +330,9 @@ const uint8_t DSEG7_Modern_BoldItalic_24[] PROGMEM = {
|
|||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xEF, 0xEF, 0x7F, 0x00, 0x4E, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0x4E, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x4E, 0xFF, 0xFF, 0xFF, 0xFF, 0x4E, 0x00, 0x7F,
|
||||
0xEF, 0xEF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// DSEG7 Modern BoldItalic 44pt strictly-monospaced smooth font
|
||||
#include <pgmspace.h>
|
||||
|
||||
const uint8_t DSEG7_Modern_BoldItalic_44[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x2C,
|
||||
|
|
@ -1038,12 +1035,12 @@ const uint8_t DSEG7_Modern_BoldItalic_44[] PROGMEM = {
|
|||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBB, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0xB0,
|
||||
0xF5, 0xF5, 0xB0, 0x32, 0x00, 0x00, 0x00, 0x32, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0x32, 0x00,
|
||||
0x00, 0xB0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB0, 0x00, 0x00, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xF5, 0x00, 0x00, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0x00, 0x00, 0xB0,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB0, 0x00, 0x00, 0x32, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5,
|
||||
0x32, 0x00, 0x00, 0x00, 0x32, 0xB0, 0xF5, 0xF5, 0xB0, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// DSEG7 Modern BoldItalic 80pt strictly-monospaced smooth font
|
||||
#include <pgmspace.h>
|
||||
|
||||
const uint8_t DSEG7_Modern_BoldItalic_80[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x50,
|
||||
|
|
@ -3350,22 +3347,22 @@ const uint8_t DSEG7_Modern_BoldItalic_80[] PROGMEM = {
|
|||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x63, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x2C, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x56,
|
||||
0x7A, 0x7A, 0x56, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8D,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11,
|
||||
0xC5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC5, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xB2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB2, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x56, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x56,
|
||||
0x00, 0x00, 0x00, 0x00, 0xB2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xB2, 0x00, 0x00, 0x00, 0x00, 0xEB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xEB, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xEB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEB, 0x00, 0x00, 0x00, 0x00, 0xB2, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB2, 0x00, 0x00, 0x00, 0x00, 0x56, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x56, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xB2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB2, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x11, 0xC5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC5, 0x11, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 66 KiB |
|
|
@ -233,8 +233,10 @@ void vBarMeter(uint8_t cell, uint8_t pid) {
|
|||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
tft.drawString(unit, x + 3, screenHeight * 0.12 - 8, 1);
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
tft.drawCentreString("---", x + w / 2,
|
||||
tft.setTextPadding(w - 6);
|
||||
tft.drawRightString("---", x + w - 4,
|
||||
screenHeight - (screenHeight * 0.12) + 1, 4);
|
||||
tft.setTextPadding(0);
|
||||
float smalltick = screenHeight * 0.75 / 50;
|
||||
// float bigtick = screenHeight*0.75/10;
|
||||
// draw number
|
||||
|
|
@ -299,8 +301,10 @@ void plotVBar(uint8_t cell, float data, int warn, int min, int max,
|
|||
result = " " + result + " ";
|
||||
break;
|
||||
}
|
||||
tft.drawCentreString(result.c_str(), x + w / 2,
|
||||
tft.setTextPadding(w - 6);
|
||||
tft.drawRightString(result.c_str(), x + w - 4,
|
||||
screenHeight - (screenHeight * 0.12) + 1, 4);
|
||||
tft.setTextPadding(0);
|
||||
old_data[pidIndex] = data; // update old data
|
||||
} // if
|
||||
}
|
||||
|
|
@ -395,11 +399,11 @@ void numericMeter4(uint8_t cell, uint8_t pid, bool redrawHeader = true) {
|
|||
// Clear only the body below the header to avoid any header flickering
|
||||
tft.fillRect(x + 1, y + 25, w - 2, h - 26, TFT_BLACK);
|
||||
|
||||
// Initial placeholder: centered DSEG7 44pt number
|
||||
// Initial placeholder: right-aligned DSEG7 44pt number
|
||||
tft.loadFont(DSEG7_Modern_BoldItalic_44);
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
tft.setTextPadding(w - 8);
|
||||
tft.drawCentreString("---", x + w / 2, y + 46, 1);
|
||||
tft.setTextPadding(w - 12);
|
||||
tft.drawRightString("---", x + w - 10, y + 46, 1);
|
||||
tft.setTextPadding(0);
|
||||
tft.unloadFont();
|
||||
}
|
||||
|
|
@ -416,8 +420,8 @@ void plotNumeric4(uint8_t cell, float data, int warn, bool digit, String unit) {
|
|||
String numStr = String(data, digit);
|
||||
tft.loadFont(DSEG7_Modern_BoldItalic_44);
|
||||
tft.setTextColor(col, TFT_BLACK);
|
||||
tft.setTextPadding(w - 8);
|
||||
tft.drawCentreString(numStr.c_str(), x + w / 2, y + 46, 1);
|
||||
tft.setTextPadding(w - 12);
|
||||
tft.drawRightString(numStr.c_str(), x + w - 10, y + 46, 1);
|
||||
tft.setTextPadding(0);
|
||||
tft.unloadFont();
|
||||
old_data[cell] = data;
|
||||
|
|
@ -453,8 +457,8 @@ void arcMeter4(uint8_t cell, uint8_t pid, bool redrawHeader = true) {
|
|||
// Value placeholder using DSEG7 Modern 24pt smooth font
|
||||
tft.loadFont(DSEG7_Modern_BoldItalic_24);
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
tft.setTextPadding(w - 50);
|
||||
tft.drawCentreString("---", x + 80, y + 86, 1);
|
||||
tft.setTextPadding(86);
|
||||
tft.drawRightString("---", x + 116, y + 86, 1);
|
||||
tft.setTextPadding(0);
|
||||
tft.unloadFont();
|
||||
}
|
||||
|
|
@ -487,8 +491,8 @@ void plotArc4(uint8_t cell, float data, int warn, int min, int max, bool digit,
|
|||
String numStr = String(data, digit);
|
||||
tft.loadFont(DSEG7_Modern_BoldItalic_24);
|
||||
tft.setTextColor(arcCol, TFT_BLACK);
|
||||
tft.setTextPadding(w - 50);
|
||||
tft.drawCentreString(numStr.c_str(), x + 80, y + 86, 1);
|
||||
tft.setTextPadding(86);
|
||||
tft.drawRightString(numStr.c_str(), x + 116, y + 86, 1);
|
||||
tft.setTextPadding(0);
|
||||
tft.unloadFont();
|
||||
old_data[cell] = data;
|
||||
|
|
@ -502,16 +506,14 @@ void fullScreenMeter(uint8_t cell, uint8_t pid, bool redrawHeader = true) {
|
|||
unit = "V";
|
||||
|
||||
if (redrawHeader) {
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
// Blue gradient header with unit in brackets only
|
||||
tft.fillRectVGradient(0, 0, 320, 38, TFT_BLUE, 0x0011);
|
||||
tft.setTextColor(TFT_WHITE);
|
||||
String headerText = label + " [" + unit + "]";
|
||||
tft.drawCentreString(headerText.c_str(), 160, 8, 4);
|
||||
} else {
|
||||
}
|
||||
// Clear only below header
|
||||
tft.fillRect(0, 38, 320, 202, TFT_BLACK);
|
||||
}
|
||||
|
||||
if (!cellIsNumeric[cell]) {
|
||||
// Arc mode full screen
|
||||
|
|
@ -522,16 +524,16 @@ void fullScreenMeter(uint8_t cell, uint8_t pid, bool redrawHeader = true) {
|
|||
|
||||
tft.loadFont(DSEG7_Modern_BoldItalic_80);
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
tft.setTextPadding(280);
|
||||
tft.drawCentreString("---", 160, 155, 1);
|
||||
tft.setTextPadding(155);
|
||||
tft.drawRightString("---", 230, 155, 1);
|
||||
tft.setTextPadding(0);
|
||||
tft.unloadFont();
|
||||
} else {
|
||||
// Digital numeric mode full screen with DSEG7 Smooth Font (Anti-Aliased)
|
||||
tft.loadFont(DSEG7_Modern_BoldItalic_80);
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
tft.setTextPadding(300);
|
||||
tft.drawCentreString("---", 160, 98, 1);
|
||||
tft.setTextPadding(295);
|
||||
tft.drawRightString("---", 295, 98, 1);
|
||||
tft.setTextPadding(0);
|
||||
tft.unloadFont();
|
||||
}
|
||||
|
|
@ -563,16 +565,16 @@ void plotFullScreen(uint8_t cell, float data, int warn, int min, int max,
|
|||
// Value below the arc using DSEG7 Modern smooth font
|
||||
tft.loadFont(DSEG7_Modern_BoldItalic_80);
|
||||
tft.setTextColor(col, TFT_BLACK);
|
||||
tft.setTextPadding(280);
|
||||
tft.drawCentreString(numStr.c_str(), 160, 155, 1);
|
||||
tft.setTextPadding(155);
|
||||
tft.drawRightString(numStr.c_str(), 230, 155, 1);
|
||||
tft.setTextPadding(0);
|
||||
tft.unloadFont();
|
||||
} else {
|
||||
// Digital numeric mode full screen with DSEG7 Smooth Font (Anti-Aliased)
|
||||
tft.loadFont(DSEG7_Modern_BoldItalic_80);
|
||||
tft.setTextColor(col, TFT_BLACK);
|
||||
tft.setTextPadding(300);
|
||||
tft.drawCentreString(numStr.c_str(), 160, 98, 1);
|
||||
tft.setTextPadding(295);
|
||||
tft.drawRightString(numStr.c_str(), 295, 98, 1);
|
||||
tft.setTextPadding(0);
|
||||
tft.unloadFont();
|
||||
}
|
||||
|
|
@ -591,11 +593,10 @@ void initScreen() {
|
|||
pidCurrentSkip[i] = pidReadSkip[i]; // skip for skip reading pid
|
||||
old_data[i] = -999; // clear old data
|
||||
}
|
||||
tft.fillScreen(TFT_BLACK); // clear screen
|
||||
|
||||
if (fullScreenCell >= 0 && fullScreenCell < 4) {
|
||||
fullScreenMeter(fullScreenCell, pidInCell[fullScreenCell]);
|
||||
} else {
|
||||
tft.fillScreen(TFT_BLACK); // clear screen
|
||||
for (uint8_t c = 0; c < 4; c++) {
|
||||
uint8_t pid = pidInCell[c];
|
||||
if (cellIsNumeric[c]) {
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ void loop() {
|
|||
if (pidIndex >= maxpidIndex) {
|
||||
pidIndex = 0; //back to pid 0
|
||||
autoDim(); //auto backlight handle
|
||||
if (showsystem) {
|
||||
if (showsystem && fullScreenCell == -1) {
|
||||
String status = String(pidRead * 1000.0 / (millis() - runtime), 0) + " p/s " + String(tempRead, 1) + "`c";
|
||||
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
|
||||
tft.drawCentreString(status.c_str(), 159, 0, 2);
|
||||
|
|
|
|||