TinyTV double digits channel numbers

Manny · 6 · 9625

Manny

  • Jr. Member
  • **
    • Posts: 5
    • View Profile
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
    • View Profile
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
    • View Profile
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 /


lennevia

  • Administrator
  • Hero Member
  • *****
    • Posts: 437
    • View Profile

knoptop

  • Newbie
  • *
    • Posts: 2
    • View Profile
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 /


lennevia

  • Administrator
  • Hero Member
  • *****
    • Posts: 437
    • View Profile
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


 

SMF spam blocked by CleanTalk