GithubHelp home page GithubHelp logo

Comments (11)

schreibfaul1 avatar schreibfaul1 commented on July 17, 2024

Hello,
You use my tft library? If so scroll tft.cpp to the end and seek for
x = TP_Send(0xD0);
y= TP_Send(0x90);
read x,y with (0,0) and (320,240) then You have th Voltage (in milliVolts) from TP controller.
Replace the constants Xmin, Xmax, Ymin, Ymax in tft.h with Your values.

In Your browser, tab config try the button "load default" to reread presets.csv.

from esp32-miniwebradio.

gonza88 avatar gonza88 commented on July 17, 2024

Yes, I use Your libraries.
I see this (in tft.cpp):

` x = TP_Send(0xD0); //x
//log_i("TP X=%i",x);
if((x<Xmin) || (x>Xmax)) return false; //außerhalb des Displays
x=Xmax-x;
_x[i]=x/xFaktor;

  y=  TP_Send(0x90); //y
  //log_i("TP y=%i",y);
  if((y<Ymin) || (y>Ymax)) return false;  //außerhalb des Displays
  y=Ymax-y;
 _y[i]=y/yFaktor;`

and I see this (in tft.h):
const uint16_t Xmax=1913; const uint16_t Xmin=150; const uint16_t Ymax=1944; const uint16_t Ymin=220;

But need step-by-step instructions, how to get needed values (where and how can I read them).

Using "Load default" button in web browser cause the ESP read only first station from presets.csv file, I can't go to next stations.

from esp32-miniwebradio.

schreibfaul1 avatar schreibfaul1 commented on July 17, 2024

maybe You have this display: TJCTM24028-SPI, ILI9341, red board?
tochpad is y-inverted. If so replace the code at the end tft.cpp
if(_rotation==0){y=TFT_HEIGHT-y;}
if(_rotation==1){tmpxy=x; x=y; y=tmpxy; y=TFT_WIDTH-y; x=TFT_HEIGHT-x;}
if(_rotation==2){x=TFT_WIDTH-x;}
if(_rotation==3){;} // do nothing

and set in tft.h:
const uint16_t Xmax=1850;
const uint16_t Xmin=170;
const uint16_t Ymax=1880;
const uint16_t Ymin=140;

from esp32-miniwebradio.

koka7777745 avatar koka7777745 commented on July 17, 2024

Dear author, tell me please how to add a red board for ILI9341, support for Russian-language fonts. And then I have at Russian stations some kryakozyabry.

from esp32-miniwebradio.

schreibfaul1 avatar schreibfaul1 commented on July 17, 2024

Hello koka7777745,
MiniWebRadio is not designed for that.
But my TFT Liibrary can support cyrillic chars. Streamtitles comes in UTF8 so You can decode it to CP1251.
In tft.h include "fonts/Garamond_cyrillic.h" (decomment line 11). Then change sub "showTitle":

void showTitle(String str){
static String title="";
str.trim(); // remove all leading or trailing whitespaces
if((_state==RADIO)&&(title==str)) return; // nothing to do
if(str.length()>4) f_has_ST=true; else f_has_ST=false;
// tft.setTextSize(4);
// if(str.length()> 45) tft.setTextSize(3);
// if(str.length()> 80) tft.setTextSize(2);
// if(str.length()>100) tft.setTextSize(1);
tft.setFont(Garamond_cyrillic_41x42);
if(str.length()> 45) tft.setFont(Garamond_cyrillic_32x33);
if(str.length()> 80) tft.setFont(Garamond_cyrillic_23x24);
if(str.length()>100) tft.setFont(Garamond_cyrillic_21x21);
displayinfo(UTF8toCp1251(str.c_str()), _yTitle, _hTitle, TFT_CYAN, 0);
title=str;
}
cyrillic_chars

All other You must do for Yourself.

sincerly
Wolle

from esp32-miniwebradio.

koka7777745 avatar koka7777745 commented on July 17, 2024

Thanks for the tips, 11 commented, and 8 commented. The rest does not come. Compilation does not go through the same mistakes. Drop the corrected files to the mail.
[email protected]

tft.h:

image

from esp32-miniwebradio.

koka7777745 avatar koka7777745 commented on July 17, 2024

And how are the logos attached to the stations?

from esp32-miniwebradio.

schreibfaul1 avatar schreibfaul1 commented on July 17, 2024

Logos are 96x96px 24bit bitmaps. You can create appropriate logos e.g. with paint.net. The filename schould be identical to the stationname (entry in presets.csv or the name You can see at the display). Copy it to the SD-Card folder "logo". If the stationname has a comma, repace it with a dot.

from esp32-miniwebradio.

schreibfaul1 avatar schreibfaul1 commented on July 17, 2024

To translate all the titles or words in russian You can try this:

tft.setFont(Garamond_cyrillic_32x33);
tft.print(UTF8toCp1251("Калинка, калинка, калинка моя! В саду ягода малинка, малинка моя!"));
tft.print(UTF8toCp1251("Ах, под сосною, под зелёною, Спать положите вы меня!"));

for example:

in setup()
// showHeadlineItem("** Internet radio **");
showHeadlineItem("ИНТЕРНЕТ-РАДИО");

and in showHeadlineItem(const char* hl)
// tft.setTextSize(2);
tft.setFont(Garamond_cyrillic_18x18);
display_info(UTF8toCp1251(hl), _yHeader, _hHeader, TFT_WHITE, 0);
...

from esp32-miniwebradio.

pilnikov avatar pilnikov commented on July 17, 2024

void showTitle(String str) {
static String title = "";
str.trim(); // remove all leading or trailing whitespaces
if ((_state == RADIO) && (title == str)) return; // nothing to do
if (str.length() > 4) f_has_ST = true; else f_has_ST = false;
/* tft.setTextSize(4);
if(str.length()> 45) tft.setTextSize(3);
if(str.length()> 80) tft.setTextSize(2);
if(str.length()>100) tft.setTextSize(1);
*/

tft.setFont(Garamond41x42cyrillic);
if (str.length() > 45) tft.setFont(Garamond32x33cyrillic);
if (str.length() > 80) tft.setFont(Garamond23x24cyrillic);
if (str.length() > 100) tft.setFont(Garamond21x21cyrillic);

displayinfo(str.c_str(), _yTitle, _hTitle, TFT_CYAN, 0);
title = str;
}
void showStation() {
tft.setFont(Garamond41x42cyrillic);
if (_stationname.length() > 45) tft.setFont(Garamond32x33cyrillic);
if (_stationname.length() > 80) tft.setFont(Garamond23x24cyrillic);
if (_stationname.length() > 100) tft.setFont(Garamond21x21cyrillic);

String str1 = "", str2 = "";
if (_stationname == "") {
// tft.setTextSize(3);
// if (_station.length() > 75) tft.setTextSize(1);
displayinfo(_station.c_str(), _yName, _hName, TFT_YELLOW, _wLogo + 14); // Show station name
showTitle(""); // and delete showstreamtitle
showFooter();
str1 = _station;
} else {
// tft.setTextSize(4);
// if (_stationname.length() > 30) tft.setTextSize(3);
displayinfo(_stationname.c_str(), _yName, _hName, TFT_YELLOW, _wLogo + 14);
showTitle("");
showFooter();
str1 = _stationname;
}
//log_i("%s", _stationname.c_str());
str1.toLowerCase();
str1.replace(",", ".");
str2 = "/logo/" + String(UTF8toASCII(str1.c_str())) + ".bmp";
//log_i("%s", _sbuf);
if (f_SD_okay) if (tft.drawBmpFile(SD, str2.c_str(), 0, _yLogo) == false) tft.drawBmpFile(SD, "/logo/unknown.bmp", 1, 22);
}
Right name of cyrillic font is Garamond32x33cyrillic

from esp32-miniwebradio.

schreibfaul1 avatar schreibfaul1 commented on July 17, 2024

Yes, use fontname Garamond32x33cyrillic

from esp32-miniwebradio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.