TinyTV double digits channel numbers

Manny · 4 · 552

Manny

• Jr. Member
• Posts: 5
How does a noob like me edit the code to make the TnyTV display double digit channel numbers?
What I mean is currently the TinyTV displays channels 0 to 9. I would like to change that to channel 0 to 20 or 1 to 20.
I Found one section in the Sketch for channel numbers that says something like 0 to 10 but when I change the 10 to something higher, only special characters are displayed beyond channel 9 on the TinyTV and are still in single digits.

Edited:
I did it. Heres the fix.

void showChannelNumber() {
char channelString[] = "00";
if(currentFileNum>9){
channelString[0]+= currentFileNum/10;
}
channelString[1] += (currentFileNum % 10);
int yOffset = 50;
int xPosition = 80;
int xWidth = display.getPrintWidth(channelString);

This fix was to use my previous changes and also uncomment the forward slashes /
« Last Edit: May 13, 2020, 07:53:52 PM by Manny »

Manny

• Jr. Member
• Posts: 5
ok so I changed this code in videoPlayerEffects.h

void showChannelNumber() {
char channelString[] = "0";
//if(currentFileNum>9){
//   channelString[0]+= currentFileNum/10;
//}
channelString[0] += (currentFileNum % 10);
int yOffset = 50;
int xPosition = 80;
int xWidth = display.getPrintWidth(channelString);

to this

void showChannelNumber() {
char channelString[] = "00";
//if(currentFileNum>9){
//   channelString[0]+= currentFileNum/10;
//}
channelString[1] += (currentFileNum % 10);
int yOffset = 50;
int xPosition = 80;
int xWidth = display.getPrintWidth(channelString);

Now I have double digits like 02, 03, 04, 05 etc. but I still cant get the channel numbers to go above 09

If I change this line
channelString[1] += (currentFileNum % 10);

to this

channelString[0] += (currentFileNum % 10);

The channels will go up by 10s like 20, 30, 40, 50  etc

Does anyone know what I cant try?

Manny

• Jr. Member
• Posts: 5
I got it working. Woohoo. I figured iit out myself.

Heres the code

void showChannelNumber() {
char channelString[] = "00";
if(currentFileNum>9){
channelString[0]+= currentFileNum/10;
}
channelString[1] += (currentFileNum % 10);
int yOffset = 50;
int xPosition = 80;
int xWidth = display.getPrintWidth(channelString);

This fix was to use my previous changes and also uncomment the forward slashes /