TEST

Dependents:   ADXL345Test ADXL345Test1

Fork of TM1638 by Wim Huiskamp

Revision:
2:532ce15ea9ec
Parent:
1:1f2453ed85d7
Child:
4:b2bbdc58967e
--- a/Font_7Seg.cpp	Sat Jan 09 14:30:43 2016 +0000
+++ b/Font_7Seg.cpp	Fri Jan 15 19:09:59 2016 +0000
@@ -1,5 +1,6 @@
 /* mbed LED Font Library, for TM1638 LED controller
  * Copyright (c) 2015, v01: WH, Initial version, Test in LEDKEY8
+ *               2016, v02: WH, Added ASCII alphabet, changed fonttable into short
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -33,35 +34,136 @@
                                    {LO(S7_ICON_GR5), HI(S7_ICON_GR5)},
                                    {LO(S7_ICON_GR6), HI(S7_ICON_GR6)},
                                    {LO(S7_ICON_GR7), HI(S7_ICON_GR7)},
-                                   {LO(S7_ICON_GR8), HI(S7_ICON_GR8)},
-                                   {LO(S7_ICON_GR9), HI(S7_ICON_GR9)},
-                                   {LO(S7_ICON_GR10), HI(S7_ICON_GR10)}                                   
+                                   {LO(S7_ICON_GR8), HI(S7_ICON_GR8)}
                                  };
 
-
 // ASCII Font definition table for transmission to TM1638
 //
 //#define FONT_7S_START     0x20
 //#define FONT_7S_END       0x7F
 //#define FONT_7S_NR_CHARS (FONT_7_END - FONT_7S_START + 1)
+
+#if (SHOW_ASCII == 1)
+//display all ASCII characters
+const short FONT_7S[]  = { 
+                             C7_SPC, //32 0x20, Space
+                             C7_EXC,
+                             C7_QTE,
+                             C7_HSH,
+                             C7_DLR,
+                             C7_PCT,
+                             C7_AMP,
+                             C7_ACC,
+                             C7_LBR,
+                             C7_RBR,                   
+                             C7_MLT,                            
+                             C7_PLS,
+                             C7_CMA,
+                             C7_MIN,
+                             C7_DPT,                             
+                             C7_RS,
+                             C7_0,   //48 0x30
+                             C7_1,
+                             C7_2,
+                             C7_3,
+                             C7_4,                   
+                             C7_5,
+                             C7_6,
+                             C7_7,
+                             C7_8,
+                             C7_9,
+                             C7_COL, //58 0x3A
+                             C7_SCL,
+                             C7_LT,
+                             C7_EQ,
+                             C7_GT,
+                             C7_QM,                             
+                             C7_AT,  //64 0x40
+                             C7_A,   //65 0x41, A
+                             C7_B,
+                             C7_C,
+                             C7_D,
+                             C7_E,
+                             C7_F,
+                             C7_G,
+                             C7_H,
+                             C7_I,
+                             C7_J,                   
+                             C7_K,
+                             C7_L,
+                             C7_M,
+                             C7_N,
+                             C7_O,
+                             C7_P,
+                             C7_Q,
+                             C7_R,
+                             C7_S,
+                             C7_T,
+                             C7_U,
+                             C7_V,
+                             C7_W,
+                             C7_X,
+                             C7_Y,
+                             C7_Z,   //90 0x5A, Z
+                             C7_SBL, //91 0x5B
+                             C7_LS,
+                             C7_SBR,
+                             C7_PWR,
+                             C7_UDS,  
+                             C7_ACC,                             
+                             C7_A,   //97 0x61, A replacing a
+                             C7_B,
+                             C7_C,
+                             C7_D,
+                             C7_E,
+                             C7_F,
+                             C7_G,
+                             C7_H,
+                             C7_I,
+                             C7_J,                   
+                             C7_K,
+                             C7_L,
+                             C7_M,
+                             C7_N,
+                             C7_O,
+                             C7_P,
+                             C7_Q,
+                             C7_R,
+                             C7_S,
+                             C7_T,
+                             C7_U,
+                             C7_V,
+                             C7_W,
+                             C7_X,
+                             C7_Y,
+                             C7_Z,   // 122 0x7A, Z replacing z
+                             C7_CBL, // 123 0x7B
+                             C7_OR,
+                             C7_CBR,
+                             C7_TLD,
+                             C7_DEL  // 127                             
+                        };
  
-const char FONT_7S[] = { 
-                         C7_0, //48 0x30
-                         C7_1,
-                         C7_2,
-                         C7_3,
-                         C7_4,                   
-                         C7_5,
-                         C7_6,
-                         C7_7,
-                         C7_8,
-                         C7_9,
-                         C7_A, //65 0x41, A
-                         C7_B,
-                         C7_C,
-                         C7_D,
-                         C7_E,
-                         C7_F
-                             };// 127                             
+#else
+//display only digits and hex characters
+const short FONT_7S[] = { 
+                           C7_0, //48 0x30
+                           C7_1,
+                           C7_2,
+                           C7_3,
+                           C7_4,                   
+                           C7_5,
+                           C7_6,
+                           C7_7,
+                           C7_8,
+                           C7_9,
+                           C7_A, //65 0x41, A
+                           C7_B,
+                           C7_C,
+                           C7_D,
+                           C7_E,
+                           C7_F
+                        };// 127
+#endif
   
 #endif 
\ No newline at end of file