Wyświetlanie na wyświetlaczu TFT - 8 wartości DS-ów

Masz pomysł na funkcjonalność lub koncepcję na rozwój projektu. Opisz wszystko tutaj.
Iceclimber
Posts: 3
Joined: Tue Nov 22, 2022 9:46 am

Post

Na wemos d1 mini można to uruchomić?
User avatar
vojtek
Posts: 48
Joined: Tue May 09, 2017 5:23 pm
Location: Chełm

Post

Pozwoliłem sobie dać do sprawdzenia Twój kod programu dla ChatGPT , coś z tego wyszło. Możecie to sprawdzić:

Code: Select all

// Ustawienie 192.168.4.1
// linki read z dowolnych 8 DS-ow w cloudzie
// Config - D1 20 sek

/* EKRAN> ST7735 o przekątnej 1,8 cala
RST   D4
CS    D3
DC    D2
CLK   D5
DIN   D7

Wemos mini
 */

#include <FS.h>               // ---- esp board manager 2.4.2
#include <WiFiClientSecure.h>
#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <WiFiManager.h>     //- https://github.com/tzapu/WiFiManager/tree/0.14 ----------
#include <ArduinoJson.h>     //--https://github.com/bblanchon/ArduinoJson/tree/v5.13.2 ---

#include <Adafruit_GFX.h>     // include Adafruit graphics library
#include <Adafruit_ST7735.h>  // include Adafruit ST7735 TFT library

const char* host = "svr.supla.org";
const int httpsPort = 443;

char Supla_server[41];
char name_1[16];
char name_2[16];
char name_3[16];
char name_4[16];
char name_5[16];
char name_6[16];
char name_7[16];
char name_8[16];

char D_Link_1[50];  // 61
char D_Link_2[50];
char D_Link_3[50];
char D_Link_4[50];
char D_Link_5[50];
char D_Link_6[50];
char D_Link_7[50];
char D_Link_8[50];

byte mac[6];
String url = "/direct/xx/xxxxxxxxx/xxx";
bool dimm = false;
unsigned long dimm_milis;
int C_W_state = HIGH;
int last_C_W_state = HIGH;
unsigned long time_last_C_W_change = 0;
long C_W_delay = 10000;           // 10 sekund
bool shouldSaveConfig = false;
bool initialConfig = false;
unsigned long link_delay = 2000;  // 4000
#define onboard_led 2    // D4
#define Config_PIN 5     // D1    // wifi config
int timeout = 120; // seconds to run for wifi Manager

float temp1;
float temp2;
float temp3;
float temp4;
float temp5;
float temp6;
float temp7;
float temp8;
int C_W_read;

#define TFT_RST   D4
#define TFT_CS    D3
#define TFT_DC    D2
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

static const unsigned char PROGMEM logo32_glcd_bmp[] =
{
  // binary data for the logo
};

void saveConfigCallback () {
  Serial.println("Should save config");
  shouldSaveConfig = true;
}

void ondemandwifiCallback () {
  WiFiManagerParameter custom_Supla_server("server", "supla server", Supla_server, 41);

  WiFiManagerParameter custom_name_1("name_1", "Nazwa_1", name_1, 16);
  WiFiManagerParameter custom_D_Link_1("Linka", "Link_z_1_DS18B20_read", D_Link_1, 50);
  WiFiManagerParameter custom_name_2("name_2", "Nazwa_2", name_2, 16);
  WiFiManagerParameter custom_D_Link_2("Linkb", "Link_z_2_DS18B20_read", D_Link_2, 50);
  WiFiManagerParameter custom_name_3("name_3", "Nazwa_3", name_3, 16);
  WiFiManagerParameter custom_D_Link_3("Linkc", "Link_z_3_DS18B20_read", D_Link_3, 50);
  WiFiManagerParameter custom_name_4("name_4", "Nazwa_4", name_4, 16);
  WiFiManagerParameter custom_D_Link_4("Linkd", "Link_z_4_DS18B20_read", D_Link_4, 50);

  WiFiManagerParameter custom_name_5("name_5", "Nazwa_5", name_5, 16);
  WiFiManagerParameter custom_D_Link_5("Linke", "Link_z_5_DS18B20_read", D_Link_5, 50);
  WiFiManagerParameter custom_name_6("name_6", "Nazwa_6", name_6, 16);
  WiFiManagerParameter custom_D_Link_6("Linkf", "Link_z_6_DS18B20_read", D_Link_6, 50);
  WiFiManagerParameter custom_name_7("name_7", "Nazwa_7", name_7, 16);
  WiFiManagerParameter custom_D_Link_7("Linkg", "Link_z_7_DS18B20_read", D_Link_7, 50);
  WiFiManagerParameter custom_name_8("name_8", "Nazwa_8", name_8, 16);
  WiFiManagerParameter custom_D_Link_8("Linkh", "Link_z_8_DS18B20_read", D_Link_8, 50);

  WiFiManager wifiManager;
  wifiManager.setBreakAfterConfig(true);
  wifiManager.setSaveConfigCallback(saveConfigCallback);

  wifiManager.addParameter(&custom_Supla_server);

  wifiManager.addParameter(&custom_name_1);
  wifiManager.addParameter(&custom_D_Link_1);
  wifiManager.addParameter(&custom_name_2);
  wifiManager.addParameter(&custom_D_Link_2);
  wifiManager.addParameter(&custom_name_3);
  wifiManager.addParameter(&custom_D_Link_3);
  wifiManager.addParameter(&custom_name_4);
  wifiManager.addParameter(&custom_D_Link_4);

  wifiManager.addParameter(&custom_name_5);
  wifiManager.addParameter(&custom_D_Link_5);
  wifiManager.addParameter(&custom_name_6);
  wifiManager.addParameter(&custom_D_Link_6);
  wifiManager.addParameter(&custom_name_7);
  wifiManager.addParameter(&custom_D_Link_7);
  wifiManager.addParameter(&custom_name_8);
  wifiManager.addParameter(&custom_D_Link_8);

  wifiManager.setCustomHeadElement("<style>html{ background-color: #01DF3A;}</style><div class='s'><svg version='1.1' id='l' x='0' y='0' viewBox='0 0 200 200' xml:space='preserve'><path d='M59.3,2.5c18.1,0.6,31.8,8,40.2,23.5c3.1,5.7,4.3,11.9,4.1,18.3c-0.1,3.6-0.7,7.1-1.9,10.6c-0.2,0.7-

elektryk nie saper myli się kilka razy :)
maniek
Posts: 19
Joined: Sun Oct 15, 2017 7:21 pm
Location: Góra

Post

Iceclimber wrote: Mon Feb 05, 2024 6:17 am Na wemos d1 mini można to uruchomić?
Pewnie że tak
Zibi
Posts: 635
Joined: Wed Jul 31, 2019 9:20 am
Location: Białogard

Post

Od momentu napisania softu wiele się zmieniło, sama biblioteka Supli jest napakowana bardziej.
Teraz taki odczyt ciężko będzie uzyskać za pomocą wemosa.
Nie jest to nie możliwe, ale polecam użyć esp32.
Chat nie zna Supli więc tam różne dziwactwa wyjdą.
maniek
Posts: 19
Joined: Sun Oct 15, 2017 7:21 pm
Location: Góra

Post

Wemos d1 mini plus wyświetlacz 2,8 zrobione na szybcika do testów:roll:
IMG_20240212_204640.jpg
IMG_20240212_204652.jpg
You do not have the required permissions to view the files attached to this post.

Return to “Pomysły i koncepcje”