Serial LCD Menu system with buttons instead of RPG. Based on Peihsun Yeh's work

Fork of Menu by Peihsun Yeh

Navigator.h

Committer:
mshuck
Date:
2013-08-04
Revision:
5:70fec61bebaf
Parent:
4:343f2993a66b

File content as of revision 5:70fec61bebaf:

#ifndef NAVIGATOR_H
#define NAVIGATOR_H

#include "mbed.h"
#include "Menu.h"
#include "SerialLCD.h"

class Navigator {   
    private: 
               
    public:
        Navigator(Menu *, SerialLCD *);
        Menu *activeMenu; // the current menu - can change when RPG is pushed on selection with child menu
        
        SerialLCD *lcd; 
        bool lastButton, button;
        
        
        int bottom;     // the index of the last item of current menu
        int cursorPos;  // what selection the cursor points to
        int cursorLine; // what line of the lcd the cursor is on. 1 = first line, 2 = second line
        
        void poll();    // repeatedly call this function to determine if RPG is being used
        void moveUp();
        void moveDown();
        void printMenu();
        void printCursor();
        void setButtons();
};

#endif