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.
Dependencies: mbed mbed-rtos MLX90614
UserInterface.h
00001 #ifndef _UI_H_ 00002 #define _UI_H_ 00003 00004 //include files 00005 #include "st7565LCD.h" 00006 #include "Header.h" 00007 #include "Item.h" 00008 #include "Menu.h" 00009 #include "Compass.h" 00010 #include "LevelMeter.h" 00011 #include "Measure.h" 00012 #include "Thermometer.h" 00013 00014 //include libs 00015 #include <string.h> 00016 #include <assert.h> 00017 #include <stdio.h> 00018 #include <stdlib.h> 00019 00020 //define brightness and contrast 00021 #define _DEFAULT_BRIGHTNESS 25 00022 #define _DEFAULT_CONTRAST 20 00023 #define _MAX_BRIGHTNESS 200 00024 #define _MIN_BRIGHTNESS 10 00025 00026 //define default color 00027 #define _DEFAULT_COLOR 20 00028 00029 //define mbed pins 00030 #define _MOSI p5 00031 #define _SCLK p7 00032 #define _RST p24 00033 #define _A0 p8 00034 #define _CS p6 00035 00036 using namespace std; 00037 00038 class Item; 00039 00040 class UI { 00041 public: 00042 00043 //functions 00044 void init(void); 00045 //update all screen 00046 void update(char c); 00047 //update header only 00048 void display(void); 00049 //update current menu 00050 void setCurrent(Item * item){ 00051 current = item; 00052 } 00053 //set header 00054 void setHeader(Header * h){ 00055 header = h; 00056 } 00057 //set header title 00058 void setHeaderTitle(char * title){ 00059 header->setTitle(title); 00060 } 00061 00062 UI(ST7565 *lcd){ 00063 current = NULL; 00064 header = NULL; 00065 st7565 = lcd; 00066 } 00067 00068 private: 00069 //variables 00070 //current selected menu 00071 Item * current; 00072 //header object 00073 Header * header; 00074 //display pointer 00075 ST7565 * st7565; 00076 //set colors 00077 void set_colors(float r, float g, float b, float aa); 00078 }; 00079 00080 #endif
Generated on Thu Jul 14 2022 11:25:14 by
1.7.2