Dilbert
Firmware for the Dilbert interactive badge.
 All Classes Files Functions Variables Enumerations Macros Pages
ProfileApp.h
Go to the documentation of this file.
1 
3 #ifndef _PROFILEAPP_H_
4 #define _PROFILEAPP_H_
5 
6 #include <StaticDisplayApp.h>
7 
14 {
15 public:
16  ProfileApp()
17  : StaticDisplayApp("Profile")
18  {
19  }
20 
21  virtual ~ProfileApp()
22  {
23  }
24 
28  virtual void run()
29  {
30  App::run();
31 
32  /* Keep backlight on */
33  m_manager->feedBacklight(BACKLIGHT_STATE_DIM);
34  }
35 
36 protected:
40  virtual void drawPortrait()
41  {
42  m_badge->display().setTextColor(ILI9341_YELLOW);
43  m_badge->display().setTextSize(6);
44  m_badge->display().println("Dan\nNixon\n");
45 
46  m_badge->display().setTextSize(3);
47  m_badge->display().setTextColor(ILI9341_CYAN);
48  m_badge->display().println("@technoducky");
49  m_badge->display().setTextColor(ILI9341_BLUE);
50  m_badge->display().println("dan-nixon.com\n");
51 
52  m_badge->display().setTextColor(ILI9341_RED);
53  m_badge->display().setTextSize(3);
54  m_badge->display().println("Code Monkey, Electronics\nEngineer, Mad\nScientist.");
55  }
56 
60  virtual void drawLandscape()
61  {
62  m_badge->display().setTextColor(ILI9341_YELLOW);
63  m_badge->display().setTextSize(5);
64  m_badge->display().println("Dan Nixon");
65 
66  m_badge->display().setTextSize(3);
67  m_badge->display().println();
68 
69  m_badge->display().setTextSize(3);
70  m_badge->display().setTextColor(ILI9341_CYAN);
71  m_badge->display().println("@technoducky");
72  m_badge->display().setTextColor(ILI9341_BLUE);
73  m_badge->display().println("dan-nixon.com\n");
74 
75  m_badge->display().setTextColor(ILI9341_RED);
76  m_badge->display().setTextSize(3);
77  m_badge->display().println("Code Monkey,\nElectronics\nEngineer,\nMad Scientist.");
78  }
79 };
80 
81 #endif
Used for displaying static content at any screen orientation.
Definition: StaticDisplayApp.h:13
virtual void run()
Called in a loop while the application is active.
Definition: ProfileApp.h:28
Adafruit_ILI9341 & display()
Gets the TFT display driver.
Definition: Dilbert.h:44
AppManager * m_manager
Pointer to application manager.
Definition: App.h:130
Displays profile/contact information on the display.
Definition: ProfileApp.h:13
virtual void run()
Called in a loop while the application is active.
Definition: App.h:83
virtual void drawLandscape()
Draws the landscape version of the content.
Definition: ProfileApp.h:60
StaticDisplayApp(char *name)
Creates a new static content application.
Definition: StaticDisplayApp.cpp:9
virtual void drawPortrait()
Draws the portrait version of the content.
Definition: ProfileApp.h:40
Dilbert * m_badge
Pointer to badge driver.
Definition: App.h:129
void feedBacklight(uint8_t status=BACKLIGHT_STATE_FULL)
Ensures that the backlight stays on, otherwise it is susceptible to the timeouts set in SystemConfigD...
Definition: AppManager.cpp:152