Example code for the PT6312 VFD driver. Also supports the PT6312 in ASCII mode as used in the Philips DVP630 DVD player.
Diff: main.cpp
- Revision:
- 2:0dd4c697fc31
- Parent:
- 1:0484256914b0
- Child:
- 4:ee70d1077e54
--- a/main.cpp Thu Aug 27 21:22:51 2015 +0000 +++ b/main.cpp Thu Sep 10 18:41:12 2015 +0000 @@ -19,9 +19,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#if(1) -// DVP630 Display Test + +#if (1) +// Philips DVP630 Display Test #include "mbed.h" #include "PT6312.h" @@ -42,25 +42,38 @@ pc.printf("Hello World\r\n"); // DVP630.cls(); - DVP630.putc('A'); +// DVP630.putc('A'); +// wait(1); + + DVP630.setUDC(0, UDC_SANDHR); //Set UDC + DVP630.putc((char) 0); + wait(1); + + DVP630.setBrightness(PT6312_BRT7); wait(1); - - DVP630.setBrightness(PT6312_BRT7); - + +//wheel + for(int cnt=0;cnt<10;cnt++) { + for(int idx=0;idx<8;idx++) { + DVP630.setUDC(0, WHEEL_ANI[idx]); + DVP630.locate(0); + DVP630.printf("%c%c%c%c%c%c%c",(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0); + + wait(0.1); + } + } + + //test to show all chars wait(1); DVP630.cls(); -// for (int i='A'; i<='Z'; i++) { -// DVP630.putc(i); -// wait(0.5); -// } - for (int i=0x20; i<0x80; i++) { - DVP630.cls(); - DVP630.printf("0x%2X=%c", i, (char) i); - wait(0.1); - pc.getc(); +// DVP630.cls(); + DVP630.locate(0); + DVP630.printf("0x%2X=%c ", i, (char) i); + wait(0.2); +// pc.getc(); } while (1) { @@ -72,11 +85,15 @@ if (keydata[0] == 0x01) { //play DVP630.cls(); DVP630.printf("AAAAAAA"); + DVP630.setIcon(PT6312_DVP630::Dig2_Col); + DVP630.setIcon(PT6312_DVP630::Dig4_Col); } if (keydata[0] == 0x02) { //stop DVP630.cls(); DVP630.printf("HELLO "); + DVP630.clrIcon(PT6312_DVP630::Dig2_Col); + DVP630.clrIcon(PT6312_DVP630::Dig4_Col); } if (keydata[0] == 0x04) { //open/close @@ -128,15 +145,11 @@ DigitalOut myled(LED1); // DisplayData_t size is 8 bytes (4 digits max 16 segments) ... 22 bytes (11 digits at max 11 segments) -// DisplayData_t size default is 14 bytes (7 digits max 15 segments) -PT6312::DisplayData_t mbed_str = {0xDA,0x00, 0x7C,0x00, 0x3C,0x01, 0xF6,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00}; -PT6312::DisplayData_t all_str = {0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F}; -//PT6312::DisplayData_t all_str = {0x0F,0x00, 0xF0,0x00, 0x00,0x0F, 0x00,0x70, 0x00,0x00, 0x00,0x00, 0x00,0x00}; - -PT6312::DisplayData_t bye_str = {0x7C,0x00, 0xEC,0x00, 0x3C,0x01, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00}; -PT6312::DisplayData_t hello_str = {0xDC,0x00, 0x3C,0x01, 0x38,0x00, 0x38,0x00, 0xF8,0x01, 0x00,0x00, 0x00,0x00}; - -PT6312::DisplayData_t mbed_txt = {LO(C_D), HI(C_D), LO(C_E), HI(C_E), LO(C_B), HI(C_B), LO(C_M), HI(C_M)}; +// DisplayData_t size default is 22 bytes (11 digits max 15 segments) +PT6312::DisplayData_t all_str = {0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F, 0xFF,0x7F}; +PT6312::DisplayData_t bye_str = {0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, LO(C_E),HI(C_E), LO(C_Y),HI(C_Y), LO(C_B),HI(C_B)}; +PT6312::DisplayData_t hello_str = {0x00,0x00, 0x00,0x00, LO(C_O),HI(C_O), LO(C_L),HI(C_L), LO(C_L),HI(C_L), LO(C_E),HI(C_E), LO(C_H), HI(C_H)}; +PT6312::DisplayData_t mbed_str = {LO(C_D), HI(C_D), LO(C_E), HI(C_E), LO(C_B), HI(C_B), LO(C_M), HI(C_M)}; // KeyData_t size is 3 bytes PT6312::KeyData_t keydata; @@ -156,7 +169,6 @@ PT6312.writeData(all_str); wait(4); PT6312.setBrightness(PT6312_BRT3); - PT6312.writeData(mbed_str); wait(1); PT6312.setBrightness(PT6312_BRT0); wait(1); @@ -181,7 +193,7 @@ if (keydata[0] == 0x04) { //open/close PT6312.cls(); // PT6312.writeData(mbed_str); - PT6312.writeData(mbed_txt); + PT6312.writeData(mbed_str); #if(0) //test to show all chars @@ -189,8 +201,8 @@ PT6312.cls(); for (int i=0; i<26; i++) { - PT6312.writeData(0, font_16A[i][0]); - PT6312.writeData(1, font_16A[i][1]); + PT6312.writeData(0, FONT_16S[i][0]); + PT6312.writeData(1, FONT_16S[i][1]); wait(1); } #endif