Overlaying Stationary Text

Store Forums Video Experimenter General Discussion Overlaying Stationary Text

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8677
    menager
    Participant

    I want to overlay my callsign on the screen. So far, I’ve got it to sweep across and down the screen, but I just want it to remain in the corner. I know it has something to with the frame rate, but I can’t figure out what part of the TVout library is responsible for that.

    #8678
    Michael
    Keymaster

    Can you post your code so I can see if something is missing? You can replace your callsign with XXXXXX if you want.

    #8679
    menager
    Participant
    #include "TVout.h"
    #include "fontALL.h"
    TVout TV;
    
    void setup() 
     {
      TV.begin(NTSC,90,40); 
      
      TV.select_font(font6x8); 
     }
     
    void loop()
     {
      TV.set_cursor(0,6);
      TV.print("XXXXX");
      delay(60);
     }
    • This reply was modified 7 years, 12 months ago by Michael.
    #8681
    Michael
    Keymaster

    When using the Video Experimenter, you have to enable overlay capability with some special code. This is demonstrated in all the example projects like: the overlay example

    Try this code for your sketch. Note the initOverlay() function and the ISR(INT0_vect) function. They are required.

    
    #include "TVout.h"
    #include "fontALL.h"
    TVout TV;
    
    void setup() 
     {
      TV.begin(NTSC,90,40); 
      initOverlay();
      TV.select_font(font6x8); 
     }
     
    // Initialize ATMega registers for video overlay capability.
    // Must be called after tv.begin().
    void initOverlay() {
      TCCR1A = 0;
      // Enable timer1.  ICES0 is set to 0 for falling edge detection on input capture pin.
      TCCR1B = _BV(CS10);
    
      // Enable input capture interrupt
      TIMSK1 |= _BV(ICIE1);
    
      // Enable external interrupt INT0 on pin 2 with falling edge.
      EIMSK = _BV(INT0);
      EICRA = _BV(ISC01);
    }
    
    // Required to reset the scan line when the vertical sync occurs
    ISR(INT0_vect) {
      display.scanLine = 0;
    }
    
    void loop()
     {
      TV.set_cursor(0,6);
      TV.print("XXXXX");
      delay(60);
     }
    • This reply was modified 7 years, 12 months ago by Michael.
    #8683
    menager
    Participant

    Thanks Michael! It worked.

    I did not understand the purpose those two functions. Definitely going to continue reading up on the TVOut documentation.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.