Jordan Earls / TermControl

Dependents:   JOGO_CORRIDA Snake mbedbreakingout

You are viewing an older revision! See the latest version

Homepage

A super simple way to implement crude terminal interfaces over Serial. (or anything that implements Stream).

Simple example:

Serial pc(USBTX, USBRX); 
int main() {
    TermControl ctrl;
    ctrl.SetTerminal(&pc);
    ctrl.Reset();
    ctrl.Clear();
    ctrl.PrintAt(5,10,"FooBar!");
    int i=0;
    i=0;
    while(1) {
        i++;
        ctrl.SetCursor(5,11);
        pc.printf("%i",i);
        
    }
}

This simple program will continuously count, but instead of scrolling and such, it will print the counted numbers in one place. In this case, row 11, column 5.

I don't break out every escape code, but I plan on adding more. Maybe even try to get some sort of support for the notion of "widgets" and such. Lightweight is my overall goal though.


All wikipages