Latest revision
Fork of capstone_display by
Revision 3:c3231b95aff0, committed 2014-04-03
- Comitter:
- jmoffat
- Date:
- Thu Apr 03 20:42:39 2014 +0000
- Parent:
- 2:a6f341df1ef1
- Commit message:
- Added documentation
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 a6f341df1ef1 -r c3231b95aff0 display.cpp --- a/display.cpp Thu Apr 03 20:24:36 2014 +0000 +++ b/display.cpp Thu Apr 03 20:42:39 2014 +0000 @@ -1,7 +1,9 @@ #include "st7735.h" #include "display.h" #include "mbed.h" - +/** +*See display.h for instructions for functions. +*/ display::display(ST7735_LCD *disp) { lcd = disp; @@ -44,17 +46,17 @@ void display::displayStr(char *newStrength) { - lcd->SetForeground(COLOR_BLACK); - lcd->Print("Strength: ", LEFT, 25); + lcd->SetForeground(COLOR_BLACK);//Set to black to overwrite old text. + lcd->Print("Strength: ", LEFT, 25);//Overwrite old text. lcd->Print(strength, CENTER, 25); - strength = newStrength; - lcd->SetForeground(COLOR_WHITE); - lcd->Print("Strength: ", LEFT, 25); + strength = newStrength;//Store new text for overwriting later. + lcd->SetForeground(COLOR_WHITE);//Set to white for printing. + lcd->Print("Strength: ", LEFT, 25);//Print. lcd->Print(strength, CENTER, 25); } -void display::displayDist(char *newDist) +void display::displayDist(char *newDist)//Works identically to above. { lcd->SetForeground(COLOR_BLACK); lcd->Print("Dist: ", LEFT, 75);
diff -r a6f341df1ef1 -r c3231b95aff0 display.h --- a/display.h Thu Apr 03 20:24:36 2014 +0000 +++ b/display.h Thu Apr 03 20:42:39 2014 +0000 @@ -11,13 +11,32 @@ display(ST7735_LCD *disp); - + /** + *Debug print that prints text in center of screen. + *Will overwrite old text. + */ void print(char *str); + /** + *Test function that prints a string repeatedly in a rainbow fashion. + */ void printrb(const char *str); - + /** + *Debug function that blinks text. + */ void blinktext(const char *str); + /** + *Displays the the strength on the screen, on the first line. + *newStrength is the number in the form of a string, with units as + *desired. Prints in format "Strength:newStrength". Will overwrite old + *value automatically. + */ void displayStr(char *newStrength); + /** + *Works identically to displayStrength, but on second line with distance. + *Prints in format "Dist:newDist". Units must be in string as desired. + *Will overwrite old value automatically. + */ void displayDist(char * newDist); }; \ No newline at end of file