This class encapsulates all the algorithms required for the displaying strings and time dependent patterns on the lcd.
Dependents: 200943412_QuickClick
Revision 17:1c52ff51c028, committed 2017-05-02
- Comitter:
- domkay97
- Date:
- Tue May 02 14:02:25 2017 +0000
- Parent:
- 16:8d158d39d438
- Commit message:
- Correcting grammar in comments
Changed in this revision
Display.cpp | Show annotated file Show diff for this revision Revisions of this file |
Display.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 8d158d39d438 -r 1c52ff51c028 Display.cpp --- a/Display.cpp Mon May 01 17:04:13 2017 +0000 +++ b/Display.cpp Tue May 02 14:02:25 2017 +0000 @@ -93,7 +93,7 @@ for (int _a = 0; _a < 8; ++_a) { //printf("for loop (a):- %d\n",a); - _drawArc(lcd, _a); + _drawArc(lcd, _a); //run through _drawArc function drawing octant specific to a value lcd.refresh(); float Brightness = ctrl.pot_value(); //set brightness to petentiometer value lcd.setBrightness(0.0); @@ -101,7 +101,7 @@ //printf("Wait used:- %3.2f\n",_w); wait(_w); lcd.setBrightness(Brightness); //Variable brightness will change with petentiometer value - wait(_w); + wait(_w); //changes after every circle is drawn to make the game more exciting. } } @@ -116,6 +116,9 @@ _x0 = 42; _y0 = 24; +//the algorithm below is a modified version of the midpoint circle algorithm from: +//https://en.wikipedia.org/wiki/Midpoint_circle_algorithm + while(_x >= _y) { switch(_a) {
diff -r 8d158d39d438 -r 1c52ff51c028 Display.h --- a/Display.h Mon May 01 17:04:13 2017 +0000 +++ b/Display.h Tue May 02 14:02:25 2017 +0000 @@ -6,7 +6,7 @@ #include "Controller.h" /** Display Class -@brief This class encapsulates all the algorithms reaquired for the displaying strings and time dependant patterns on the lcd. +@brief This class encapsulates all the algorithms required for the displaying strings and time dependant patterns on the lcd. @author Dominic Kay @date April 2017 @@ -30,7 +30,7 @@ /** - * @brief Methord for resetting the wait time if multi-player + * @brief Method for resetting the wait time if multi-player * @param class variable w * @return void */ @@ -44,7 +44,7 @@ /** * @brief Displays a random instruction for the user to perform - * @param ran random number generated from operator + * @param ran (random number generated from operator) * @return void */ void display_instruction(N5110 &lcd, int ran); @@ -56,14 +56,14 @@ void _calculateWait(); /** - @brief Methord allowing one octant to be displayed at one time. Also allows interaction with controller for flashing screen and sounds + @brief Method 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) + @return interger used in for loop (representing number of loops) */ void _arc_selector(Controller &ctrl, N5110 &lcd); /** - * @brief An algorithm that draws the eight octants of a circle pixel by pixel + * @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 */