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.
CostumCharacters.cpp
00001 #include "CostumCharacters.h" 00002 #include "TextLCD.h" 00003 #include <string> 00004 00005 00006 CostumCharacters::CostumCharacters( TextLCD * lcd ) 00007 { 00008 this->lcd = lcd; 00009 } 00010 00011 void CostumCharacters::setBatteryIcon( int lvl ) 00012 { 00013 switch( lvl ) { 00014 case 0: 00015 { 00016 char batteryIcon0[] = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1F}; 00017 lcd->defineChar( 1, batteryIcon0 ); 00018 } 00019 break; 00020 case 1: 00021 { 00022 char batteryIcon1[8] = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x11, 0x1F, 0x1F}; 00023 lcd->defineChar( 1, batteryIcon1 ); 00024 } 00025 break; 00026 case 2: 00027 { 00028 char batteryIcon2[8] = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x1F, 0x1F, 0x1F}; 00029 lcd->defineChar( 1, batteryIcon2 ); 00030 } 00031 break; 00032 case 3: 00033 { 00034 char batteryIcon3[8] = {0x0E, 0x1F, 0x11, 0x11, 0x1F, 0x1F, 0x1F, 0x1F}; 00035 lcd->defineChar( 1, batteryIcon3 ); 00036 } 00037 break; 00038 case 4: 00039 { 00040 char batteryIcon4[8] = {0x0E, 0x1F, 0x11, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}; 00041 lcd->defineChar( 1, batteryIcon4 ); 00042 } 00043 break; 00044 case 5: 00045 { 00046 char batteryIcon5[8] = {0x0E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}; 00047 lcd->defineChar( 1, batteryIcon5 ); 00048 } 00049 break; 00050 } 00051 } 00052 00053 void CostumCharacters::setGpsIcon( int gpsFix ) 00054 { 00055 switch( gpsFix ) { 00056 case 0: 00057 { 00058 char gpsIcon0[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 00059 lcd->defineChar( 2, gpsIcon0 ); 00060 } 00061 break; 00062 case 1: 00063 { 00064 char gpsIcon1[8] = {0x00, 0x0E, 0x1B, 0x11, 0x1B, 0x0E, 0x0E, 0x04}; 00065 lcd->defineChar( 2, gpsIcon1 ); 00066 } 00067 break; 00068 } 00069 } 00070 00071 void CostumCharacters::setLoraIcon( int lora ) 00072 { 00073 switch( lora ) { 00074 case 0: 00075 { 00076 char loraIcon0[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 00077 lcd->defineChar( 3, loraIcon0 ); 00078 } 00079 break; 00080 case 1: 00081 { 00082 char loraIcon1[8] = {0x00, 0x1F, 0x0E, 0x04, 0x04, 0x04, 0x04, 0x04}; 00083 lcd->defineChar( 3, loraIcon1 ); 00084 } 00085 break; 00086 } 00087 } 00088 00089 void CostumCharacters::setLoraStatusIcon( int loraStatus ) 00090 { 00091 switch( loraStatus ) { 00092 case 0: 00093 { 00094 char loraStatus0[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 00095 lcd->defineChar( 4, loraStatus0 ); 00096 } 00097 break; 00098 case 1: 00099 { 00100 char loraStatus1[8] = {0x04, 0x0E, 0x1F, 0x04, 0x04, 0x04, 0x04, 0x04}; 00101 lcd->defineChar( 4, loraStatus1 ); 00102 } 00103 break; 00104 case 2: 00105 { 00106 char loraStatus2[8] = {0x04, 0x04, 0x04, 0x04, 0x04, 0x1F, 0x0E, 0x04}; 00107 lcd->defineChar( 4, loraStatus2 ); 00108 } 00109 break; 00110 } 00111 } 00112
Generated on Fri Jul 22 2022 16:00:05 by
1.7.2