1
User Projects / Code Examples / TinyTV double digits channel numbers
« on: May 13, 2020, 03:56:52 PM »
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 /
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 /