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.
Braille_In.cpp
00001 #include "Braille_In.h" 00002 00003 00004 00005 char* BrailleInput::translateBraille(char* input, int numChars) 00006 { 00007 00008 bool NextCaps=false; 00009 for (int i=0;i<numChars;i++) 00010 { 00011 output[i]=translateBrailleChar(input[i],NextCaps); 00012 } 00013 output[numChars+1]='\0'; 00014 return output; 00015 } 00016 00017 00018 char* BrailleInput::translateBraille(const char* input, int numChars) 00019 { 00020 00021 bool NextCaps=false; 00022 for (int i=0;i<numChars;i++) 00023 { 00024 output[i]=translateBrailleChar(input[i],NextCaps); 00025 } 00026 output[numChars+1]='\0'; 00027 return output; 00028 00029 } 00030 00031 char BrailleInput::translateBrailleChar(char input, bool& NextCaps) 00032 { 00033 NextCaps=false; 00034 char out; 00035 bool undefined=false; 00036 00037 00038 switch(input){ 00039 case 1: 00040 out='a'; 00041 break; 00042 case 3: 00043 out='b'; 00044 break; 00045 case 9: 00046 out='c'; 00047 break; 00048 case 25: 00049 out='d'; 00050 break; 00051 case 17: 00052 out='e'; 00053 break; 00054 case 11: 00055 out='f'; 00056 break; 00057 case 27: 00058 out='g'; 00059 break; 00060 case 19: 00061 out='h'; 00062 break; 00063 case 10: 00064 out='i'; 00065 break; 00066 case 26: 00067 out='j'; 00068 break; 00069 case 5: 00070 out='k'; 00071 break; 00072 case 7: 00073 out='l'; 00074 break; 00075 case 13: 00076 out='m'; 00077 break; 00078 case 29: 00079 out='n'; 00080 break; 00081 case 21: 00082 out='o'; 00083 break; 00084 case 15: 00085 out='p'; 00086 break; 00087 case 31: 00088 out='q'; 00089 break; 00090 case 23: 00091 out='r'; 00092 break; 00093 case 14: 00094 out='s'; 00095 break; 00096 case 30: 00097 out='t'; 00098 break; 00099 case 37: 00100 out='u'; 00101 break; 00102 case 39: 00103 out='v'; 00104 break; 00105 case 58: 00106 out='w'; 00107 break; 00108 case 45: 00109 out='x'; 00110 break; 00111 case 61: 00112 out='y'; 00113 break; 00114 case 53: 00115 out='z'; 00116 break; 00117 case 38: 00118 out='?'; 00119 break; 00120 case 50: 00121 out='.'; 00122 break; 00123 case 22: 00124 out='!'; 00125 break; 00126 case 18: 00127 out=':'; 00128 break; 00129 case 6: 00130 out=';'; 00131 break; 00132 case 0: 00133 out=' '; 00134 break; 00135 case 32: 00136 out=' '; 00137 NextCaps=true; 00138 break; 00139 case 127: 00140 out=' '; 00141 break; 00142 00143 default: 00144 out=' '; 00145 } 00146 00147 00148 00149 00150 00151 00152 if (NextCaps) 00153 { 00154 00155 //out=out-0x20; 00156 NextCaps=false; 00157 } 00158 00159 00160 if (input== 0x0) 00161 { 00162 out=' '; 00163 } 00164 00165 return out; 00166 } 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182
Generated on Thu Jul 14 2022 21:52:26 by
1.7.2