Comments (11)
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.
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.
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.
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.
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;
}
All other You must do for Yourself.
sincerly
Wolle
from esp32-miniwebradio.
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:
from esp32-miniwebradio.
And how are the logos attached to the stations?
from esp32-miniwebradio.
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.
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.
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.
Yes, use fontname Garamond32x33cyrillic
from esp32-miniwebradio.
Related Issues (20)
- 00:03:06 connection to NTP failed, trying again HOT 1
- W5500 HOT 6
- ESP32 configuration only, Error: 'BT_EMITTER_CONNECT' was not declared in this scope (common.h) HOT 3
- alarm clock HOT 2
- Problem when scrolling long lists on DLNA server HOT 4
- Stations not updated HOT 2
- I have a problem with the platformIO.ini MissingPackageManifestError: HOT 4
- MP3Decoder could not be initialized HOT 3
- v3.1 fresh install problems HOT 13
- screen update in ver 3.1 HOT 3
- Wifi connection to networks without password HOT 3
- Turn display off HOT 3
- Recent Changes in common.h HOT 7
- Just a few things HOT 6
- ESP-IDF based build really needed? HOT 2
- Alarm clock with or without bell HOT 5
- Use FFAT instead of SD. HOT 1
- Pin of sleep mode HOT 8
- BT Volume HOT 1
- BT implementation HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32-miniwebradio.