LCD Display Help

  1. 10 months ago

    Mack_P

    12 Jan 2018 Ohio 4810 B

    Me and my team mate are programming an LCD for our competition robot and we were wondering if it could do multiple function at once. We want it to show battery power along with being able to select an autonomous to use. We also saw a video of a team that had the back light of the LCD start flashing when there was 10 seconds left in the match.

    You can control every single character of the display if you wish to.

    void displayLCDString(const int nLine, const int nPos, string sString)

    lets you selectively rewrite parts of the display while keeping the rest intact (and without moving the display "cursor", thus safe to use from background threads.

    You can also control the backlight by setting bLCDBacklight global boolean, so flashing could be easily done by a task like this:

    task flasher() {
        int i;
        bLCDBacklight = true;
    
        wait(95, seconds);
        for (i=0; i<20; i++) {
            bLCDBacklight = !bLCDBacklight;
            wait(500, milliseconds);
        }
    }

    You would just start that task at the start of your usercontrol task.
    See the full LCD API .

  2. nenik

    12 Jan 2018 V5 Beta Tester Answer

    You can control every single character of the display if you wish to.

    void displayLCDString(const int nLine, const int nPos, string sString)

    lets you selectively rewrite parts of the display while keeping the rest intact (and without moving the display "cursor", thus safe to use from background threads.

    You can also control the backlight by setting bLCDBacklight global boolean, so flashing could be easily done by a task like this:

    task flasher() {
        int i;
        bLCDBacklight = true;
    
        wait(95, seconds);
        for (i=0; i<20; i++) {
            bLCDBacklight = !bLCDBacklight;
            wait(500, milliseconds);
        }
    }

    You would just start that task at the start of your usercontrol task.
    See the full LCD API .

 

or Sign Up to reply!