TinyCircuits Forum
General Category => User Projects / Code Examples => Topic started by: Manny 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 /
-
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?
-
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 /
-
Well done!
Thanks for updating with your findings!
-
I'm new to all this stuff, but I have Arduino IDE and wanted to customize the TinyTV code
but I'm already stuck with it asking what board I have.. and I can't find any details of the exact board for the TinyTV.
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 /
-
Hi there,
The processor is the TinyScreen+ board, get started with the software and boards package you need here: https://learn.tinycircuits.com/Processors/TinyScreen%2B_Setup_Tutorial/
Then you can follow this tutorial to download and then upload the TinyTV code to the TinyScreen+ and start editing it: https://learn.tinycircuits.com/Kits/Tiny-Video-Program/
You can also check out some of the built in settings here that require no programming: https://learn.tinycircuits.com/Kits/TinyTV-Tutorial/
Cheers,
RĂ©na