This class encapsulates all the algorithms required for the displaying strings and time dependent patterns on the lcd.

Dependents:   200943412_QuickClick

Display.h

Committer:
domkay97
Date:
2017-04-23
Revision:
14:dd1f98f7d43a
Parent:
12:41e9ba6d65d3
Child:
16:8d158d39d438

File content as of revision 14:dd1f98f7d43a:

#ifndef DISPLAY_H
#define DISPLAY_H

#include "mbed.h"
#include "N5110.h" 
#include "Controller.h"

class Display
{

public:
   
   /** Constructor */
    Display(); 
    
    /** Destructor */
    ~Display();
    
    /** Sets all variables to zero and resets wait time to max value */
    void init();
    
    /** Method for drawing the circle and decreasing the wait time */
    void drawCircle(Controller &ctrl, N5110 &lcd); 
    
    
    /**
     * @brief Methord for resetting the wait time if multi-player 
     * @param class variable w
     * @return void
     */  
    void put_wait(float w); 
    
    /**
     * @brief Method for getting the wait time if multi-player 
     * @return wait time
     */ 
    float get_wait(); 
    
    /**
     * @brief Displays a random instruction for the user to perform 
     * @param ran random number generated from operator
     * @return void
     */
    void display_instruction(N5110 &lcd, int ran); 
    
    /** Methord for the mathematical operation behind the change in time before gameover */
    void calculateWait();  

     
private:
      
    /** 
    @brief Methord allowing one octant to be displayed at one time. Also allows interaction with controller for flashing screen and sounds 
    @param id[in] void
    @return interger used in for loop (representing nember of loops) 
    */
    void Circle(Controller &ctrl, N5110 &lcd); 
    
    /**
     * @brief An algorithm that draws the eight octants of a circle pixel by pixel
     * @param id[in] interger used in for loop from Circle() Methord
     * @return void
     */
    void Drawarc(N5110 &lcd, int a); 
    
    int _h;             // <<number of arcs displayed        
    float _w;           // <<wait time 
    int _a;             // <<for loop variable 
    int _v;             // <<interger to tell class which random instuction to perform
    int x;              // <<radius of circle
    int y;              // <<y co-ordinate 
    int x0;             // <<variable used to modify x
    int y0;             // <<variable used to modify y
    int radiusMod;      // <<1 - the radius of the circle
    

};
#endif