Text display program

Store Forums Video Experimenter Bugs/Problems Text display program

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #418
    shobhabhat
    Member

    hi…i’m shobha…i have recently buyed video experimenter and was trying the text dispaly program the link is
    http://www.nootropicdesign.com/ve/projects.html

    i jsut want only text display on my tv hence edited the program
    #include
    #include

    #define W 136
    #define H 96

    TVout tv;
    unsigned char x,y;
    unsigned char originx = 5;
    unsigned char originy = 80;
    unsigned char plotx = originx;
    unsigned char ploty = 40;
    char s[32];
    unsigned int n = 0;
    int index = 0;
    int messageLen = 32;
    char message[] = “…OVERLAY TEXT AND GRAPHICS ON A VIDEO SIGNAL…OVERLAY TEXT AND GRAPHICS ON A VIDEO SIGNAL”;
    char saveChar;

    void setup() {
    tv.begin(NTSC, W, H);
    initOverlay();
    tv.select_font(font6x8);
    // tv.fill(0);

    randomSeed(analogRead(0));
    }
    // 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(ISC11);
    }

    // Required to reset the scan line when the vertical sync occurs
    ISR(INT0_vect) {
    display.scanLine = 0;
    }

    void loop() {
    saveChar = message[index+22];
    message[index+22] = ‘’;

    for(int x=6;x>=0;x–) {
    if (x<6) {
    tv.delay_frame(1);
    }
    tv.print(x, 87, message+index);

    }

    message[index+22] = saveChar;
    index++;
    if (index > 45) {
    index = 0;
    }

    }

    ofcourse i’m getting the output but since i’m a very bad programmer i dint understand what exactly is happening inside the void loop() function ????
    message[index+22] = ‘’; why this is given null here ???
    even in the for loop why x=6??
    totally i’m not getting the concept inside void loop() function..
    can anybody help me please!!

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.