Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of capstone_display by
display.cpp
- Committer:
- jmoffat
- Date:
- 2014-03-24
- Revision:
- 0:6846cd4549ba
- Child:
- 1:a6f341df1ef1
File content as of revision 0:6846cd4549ba:
#include "st7735.h" #include "display.h" #include "mbed.h" display::display(ST7735_LCD *disp) { lcd = disp; lcd->Initialize(); lcd->ClearScreen(); strength = " "; } void display::print(char *str) { lcd->SetFont( &TerminusFont ); lcd->SetForeground(COLOR_BLACK); lcd->Print(strength, CENTER, 50); strength = str; lcd->SetForeground(COLOR_WHITE); lcd->Print(str, CENTER, 50); } void display::printrb(const char *str) { lcd->SetForeground(COLOR_RED); lcd->Print(str, CENTER, 0); lcd->SetForeground(COLOR_CYAN); lcd->Print(str, CENTER, 25); lcd->SetForeground(COLOR_YELLOW); lcd->Print(str, CENTER, 50); lcd->SetForeground(COLOR_GREEN); lcd->Print(str, CENTER, 75); } void display::blinktext(const char *str) { lcd->SetForeground(COLOR_GREEN); wait(1); lcd->Print(str, CENTER, 55); lcd->SetForeground(COLOR_BLACK); wait(1); lcd->Print(str, CENTER, 55); } void display::displayStr(double dNewStrength) { lcd->SetForeground(COLOR_BLACK); // lcd->Print("Strength: "+strength, CENTER, 25); //strength = to_string(dNewStrength); lcd->SetForeground(COLOR_WHITE); //lcd->Print("Strength: "+newstr, CENTER, 25); }