index.js
function anim( _line ){

    var msg = messages[ _line ];

    lcd.cursor( _line, 0 );

    if( msg.progress === 0 ){

        lcd.print( msg.msg );

        progress( _line );

        (function( _line ){
            timeout = setTimeout(function(){
                anim( _line )
            }, anim_settings.firstCharPauseDuration );
        })( _line );

    }else{

        lcd.print( msg.msg.substr( msg.progress ) );

        progress( _line );

        (function( _line ){

            var time = anim_settings.scrollingDuration;

            if( messages[ _line ].progress === 0 ){
                time = anim_settings.lastCharPauseDuration;
            }

            timeout = setTimeout( function(){
                anim( _line );
            }, time );

        })( _line );

    }
}
function anim( _line ){

    var msg = messages[ _line ];

    lcd.cursor( _line, 0 );

    if( msg.progress === 0 ){

        lcd.print( msg.msg );

        progress( _line );

        (function( _line ){
            timeout = setTimeout(function(){
                anim( _line )
            }, anim_settings.firstCharPauseDuration );
        })( _line );

    }else{

        lcd.print( msg.msg.substr( msg.progress ) );

        progress( _line );

        (function( _line ){

            var time = anim_settings.scrollingDuration;

            if( messages[ _line ].progress === 0 ){
                time = anim_settings.lastCharPauseDuration;
            }

            timeout = setTimeout( function(){
                anim( _line );
            }, time );

        })( _line );

    }
}
function anim ( _line ) { var msg = messages [ _line ] ; lcd . cursor ( _line , 0 ) ; if ( msg . progress === 0 ) { lcd . print ( msg . msg ) ; progress ( _line ) ; ( function ( _line ) { timeout = setTimeout ( function ( ) { anim ( _line ) } , anim_settings . firstCharPauseDuration ) ; } ) ( _line ) ; } else { lcd . print ( msg . msg . substr ( msg . progress ) ) ; progress ( _line ) ; ( function ( _line ) { var time = anim_settings . scrollingDuration ; if ( messages [ _line ] . progress === 0 ) { time = anim_settings . lastCharPauseDuration ; } timeout = setTimeout ( function ( ) { anim ( _line ) ; } , time ) ; } ) ( _line ) ; } }
Animate the text on screen

@param (int) _line - Line index
Animate the text on screen