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
Revision 0:6846cd4549ba, committed 2014-03-24
- Comitter:
- jmoffat
- Date:
- Mon Mar 24 23:59:30 2014 +0000
- Child:
- 1:b98cc52519e9
- Child:
- 2:a6f341df1ef1
- Commit message:
- yep
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TFTLCD.lib Mon Mar 24 23:59:30 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/ttodorov/code/TFTLCD/#26491d710e72
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/display.cpp Mon Mar 24 23:59:30 2014 +0000
@@ -0,0 +1,53 @@
+#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);
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/display.h Mon Mar 24 23:59:30 2014 +0000
@@ -0,0 +1,20 @@
+#include "st7735.h"
+
+class display
+{
+ ST7735_LCD *lcd;
+ char *strength;
+ char *dist;
+
+ public:
+
+ display(ST7735_LCD *disp);
+
+
+ void print(char *str);
+ void printrb(const char *str);
+
+ void blinktext(const char *str);
+
+ void displayStr(double strength);
+};
\ No newline at end of file
