N5110 Library for "Racing Cars" Game

Dependents:   RacingCarsGame

Fork of N5110 by Craig Evans

Files at this revision

API Documentation at this revision

Comitter:
el13gs
Date:
Mon May 11 16:15:39 2015 +0000
Parent:
22:428cbc6df6ea
Commit message:
N5110 LCD Library for "Racing Cars" Game

Changed in this revision

N5110.cpp Show annotated file Show diff for this revision Revisions of this file
N5110.h Show annotated file Show diff for this revision Revisions of this file
diff -r 428cbc6df6ea -r 603c9e138aca N5110.cpp
--- a/N5110.cpp	Fri May 08 12:58:05 2015 +0000
+++ b/N5110.cpp	Mon May 11 16:15:39 2015 +0000
@@ -450,7 +450,7 @@
             if (type == 0)   // if 'white' line, turn off pixel
                 clearPixel(x,y);
             else
-                clearPixel(x,y);  // else if 'black' or 'dotted' turn on pixel
+                clearPixel(x,y);  // else if 'black' or 'dotted' turn off pixel
 
         }
     } else {
diff -r 428cbc6df6ea -r 603c9e138aca N5110.h
--- a/N5110.h	Fri May 08 12:58:05 2015 +0000
+++ b/N5110.h	Mon May 11 16:15:39 2015 +0000
@@ -310,17 +310,50 @@
     */
     void drawRect(int x0,int y0,int width,int height,int fill);
     
+    
+    /** Set Game Lanes
+    *
+    *   This function sets the Lanes and boundaries of the game
+    */
     void gameLanes();
     
+    
+    /** Set XY Address
+    * 
+    *   Sets the X and Y address of where the next data sent to the displa will be written in RAM.
+    *   @param  x - the column number (0 to 83) - is automatically incremented after data is written
+    *   @param  y - the row number (0 to 5) - the diplay is split into 6 banks - each bank can be considered a row
+    */
     void setXYAddress(int x, int y);
     
+    
+    /** Clear Circle
+    *
+    *   This function clears a circle at the specified origin with specified radius to the display.
+    *   Uses the midpoint circle algorithm.
+    *   @see http://en.wikipedia.org/wiki/Midpoint_circle_algorithm
+    *   @param  x0 - x-coordinate of centre
+    *   @param  y0 - y-coordinate of centre
+    *   @param  radius - radius of circle in pixels
+    *   @param  fill - 0 transparent (w/outline), 1 filled black, 2 filled white (wo/outline)
+    */
     void clearCircle(int x0,int y0,int radius,int fill);
     
+    
+    /** Clear Line
+    *
+    *   This function clears an existing line between the specified points using linear interpolation.
+    *   @param  x0 - x-coordinate of first point
+    *   @param  y0 - y-coordinate of first point
+    *   @param  x1 - x-coordinate of last point
+    *   @param  y1 - y-coordinate of last point
+    *   @param  type - 0 white,1 black,2 dotted
+    */
     void clearLine(int x0,int y0,int x1,int y1,int type);
 
+
 private:
 
-    //void setXYAddress(int x, int y);
     void initSPI();
     void turnOn();
     void reset();