can't push chnages :(
Dependencies: PinDetect TextLCD mbed
Fork of FBRDash by
src/bigchar.cpp@3:cb334e1d31c6, 2012-06-25 (annotated)
- Committer:
- tomontoast
- Date:
- Mon Jun 25 21:49:52 2012 +0000
- Revision:
- 3:cb334e1d31c6
- Parent:
- 2:825f572902c6
Test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
intrinseca | 1:b3907b8d9f65 | 1 | #include "TextLCD.h" |
intrinseca | 1:b3907b8d9f65 | 2 | #include "bigchar.h" |
intrinseca | 1:b3907b8d9f65 | 3 | |
intrinseca | 2:825f572902c6 | 4 | //Set up character memory on LCD for drawing two line numbers |
intrinseca | 1:b3907b8d9f65 | 5 | void setup_bigchar(TextLCD* lcd) |
intrinseca | 1:b3907b8d9f65 | 6 | { |
intrinseca | 1:b3907b8d9f65 | 7 | int top_left[8] = {0x07, 0x0F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, }; |
intrinseca | 1:b3907b8d9f65 | 8 | lcd->writeCGRAM(TOP_LEFT, top_left); |
intrinseca | 1:b3907b8d9f65 | 9 | |
intrinseca | 1:b3907b8d9f65 | 10 | int top_right[8] = {0x1C, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, }; |
intrinseca | 1:b3907b8d9f65 | 11 | lcd->writeCGRAM(TOP_RIGHT, top_right); |
intrinseca | 1:b3907b8d9f65 | 12 | |
intrinseca | 1:b3907b8d9f65 | 13 | int bottom_right[8] = {0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1E, 0x1C, }; |
intrinseca | 1:b3907b8d9f65 | 14 | lcd->writeCGRAM(BOTTOM_RIGHT, bottom_right); |
intrinseca | 1:b3907b8d9f65 | 15 | |
intrinseca | 1:b3907b8d9f65 | 16 | int bottom_left[8] = {0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x0F, 0x07, }; |
intrinseca | 1:b3907b8d9f65 | 17 | lcd->writeCGRAM(BOTTOM_LEFT, bottom_left); |
intrinseca | 1:b3907b8d9f65 | 18 | |
intrinseca | 1:b3907b8d9f65 | 19 | int two_lines[8] = {0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F, }; |
intrinseca | 1:b3907b8d9f65 | 20 | lcd->writeCGRAM(TWO_LINES, two_lines); |
intrinseca | 1:b3907b8d9f65 | 21 | |
intrinseca | 1:b3907b8d9f65 | 22 | int bottom[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, }; |
intrinseca | 1:b3907b8d9f65 | 23 | lcd->writeCGRAM(BOTTOM, bottom); |
intrinseca | 1:b3907b8d9f65 | 24 | |
intrinseca | 1:b3907b8d9f65 | 25 | int top[8] = {0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, }; |
intrinseca | 1:b3907b8d9f65 | 26 | lcd->writeCGRAM(TOP, top); |
intrinseca | 1:b3907b8d9f65 | 27 | |
intrinseca | 1:b3907b8d9f65 | 28 | int two_lines_5[8] = {0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1E, 0x1F, }; |
intrinseca | 1:b3907b8d9f65 | 29 | lcd->writeCGRAM(TWO_LINES_5, two_lines_5); |
intrinseca | 1:b3907b8d9f65 | 30 | } |
intrinseca | 1:b3907b8d9f65 | 31 | |
intrinseca | 2:825f572902c6 | 32 | //Draw two-line numbers |
intrinseca | 1:b3907b8d9f65 | 33 | void write_bigchar(TextLCD* lcd, int position, int number) |
intrinseca | 1:b3907b8d9f65 | 34 | { |
intrinseca | 1:b3907b8d9f65 | 35 | switch(number) |
intrinseca | 1:b3907b8d9f65 | 36 | { |
intrinseca | 1:b3907b8d9f65 | 37 | case 0: |
intrinseca | 1:b3907b8d9f65 | 38 | lcd->locate(position, 0); |
intrinseca | 1:b3907b8d9f65 | 39 | lcd->putc(TOP_LEFT); |
intrinseca | 1:b3907b8d9f65 | 40 | lcd->putc(TOP); |
intrinseca | 1:b3907b8d9f65 | 41 | lcd->putc(TOP_RIGHT); |
intrinseca | 1:b3907b8d9f65 | 42 | lcd->locate(position, 1); |
intrinseca | 1:b3907b8d9f65 | 43 | lcd->putc(BOTTOM_LEFT); |
intrinseca | 1:b3907b8d9f65 | 44 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 45 | lcd->putc(BOTTOM_RIGHT); |
intrinseca | 1:b3907b8d9f65 | 46 | break; |
intrinseca | 1:b3907b8d9f65 | 47 | case 1: |
intrinseca | 1:b3907b8d9f65 | 48 | lcd->locate(position, 0); |
intrinseca | 1:b3907b8d9f65 | 49 | lcd->putc(TOP); |
intrinseca | 1:b3907b8d9f65 | 50 | lcd->putc(TOP_RIGHT); |
intrinseca | 1:b3907b8d9f65 | 51 | lcd->putc(BLANK); |
intrinseca | 1:b3907b8d9f65 | 52 | lcd->locate(position, 1); |
intrinseca | 1:b3907b8d9f65 | 53 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 54 | lcd->putc(FULL); |
intrinseca | 1:b3907b8d9f65 | 55 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 56 | break; |
intrinseca | 1:b3907b8d9f65 | 57 | case 2: |
intrinseca | 1:b3907b8d9f65 | 58 | lcd->locate(position, 0); |
intrinseca | 1:b3907b8d9f65 | 59 | lcd->putc(TWO_LINES); |
intrinseca | 1:b3907b8d9f65 | 60 | lcd->putc(TWO_LINES); |
intrinseca | 1:b3907b8d9f65 | 61 | lcd->putc(TOP_RIGHT); |
intrinseca | 1:b3907b8d9f65 | 62 | lcd->locate(position, 1); |
intrinseca | 1:b3907b8d9f65 | 63 | lcd->putc(BOTTOM_LEFT); |
intrinseca | 1:b3907b8d9f65 | 64 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 65 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 66 | break; |
intrinseca | 1:b3907b8d9f65 | 67 | case 3: |
intrinseca | 1:b3907b8d9f65 | 68 | lcd->locate(position, 0); |
intrinseca | 1:b3907b8d9f65 | 69 | lcd->putc(TOP); |
intrinseca | 1:b3907b8d9f65 | 70 | lcd->putc(TWO_LINES); |
intrinseca | 1:b3907b8d9f65 | 71 | lcd->putc(TOP_RIGHT); |
intrinseca | 1:b3907b8d9f65 | 72 | lcd->locate(position, 1); |
intrinseca | 1:b3907b8d9f65 | 73 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 74 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 75 | lcd->putc(BOTTOM_RIGHT); |
intrinseca | 1:b3907b8d9f65 | 76 | break; |
intrinseca | 1:b3907b8d9f65 | 77 | case 4: |
intrinseca | 1:b3907b8d9f65 | 78 | lcd->locate(position, 0); |
intrinseca | 1:b3907b8d9f65 | 79 | lcd->putc(BOTTOM_LEFT); |
intrinseca | 1:b3907b8d9f65 | 80 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 81 | lcd->putc(FULL); |
intrinseca | 1:b3907b8d9f65 | 82 | lcd->locate(position, 1); |
intrinseca | 1:b3907b8d9f65 | 83 | lcd->putc(BLANK); |
intrinseca | 1:b3907b8d9f65 | 84 | lcd->putc(BLANK); |
intrinseca | 1:b3907b8d9f65 | 85 | lcd->putc(FULL); |
intrinseca | 1:b3907b8d9f65 | 86 | break; |
intrinseca | 1:b3907b8d9f65 | 87 | case 5: |
intrinseca | 1:b3907b8d9f65 | 88 | lcd->locate(position, 0); |
intrinseca | 1:b3907b8d9f65 | 89 | lcd->putc(FULL); |
intrinseca | 1:b3907b8d9f65 | 90 | lcd->putc(TWO_LINES); |
intrinseca | 1:b3907b8d9f65 | 91 | lcd->putc(TWO_LINES_5); |
intrinseca | 1:b3907b8d9f65 | 92 | lcd->locate(position, 1); |
intrinseca | 1:b3907b8d9f65 | 93 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 94 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 95 | lcd->putc(BOTTOM_RIGHT); |
intrinseca | 1:b3907b8d9f65 | 96 | break; |
intrinseca | 1:b3907b8d9f65 | 97 | case 6: |
intrinseca | 1:b3907b8d9f65 | 98 | lcd->locate(position, 0); |
intrinseca | 1:b3907b8d9f65 | 99 | lcd->putc(TOP_LEFT); |
intrinseca | 1:b3907b8d9f65 | 100 | lcd->putc(TWO_LINES); |
intrinseca | 1:b3907b8d9f65 | 101 | lcd->putc(TWO_LINES_5); |
intrinseca | 1:b3907b8d9f65 | 102 | lcd->locate(position, 1); |
intrinseca | 1:b3907b8d9f65 | 103 | lcd->putc(BOTTOM_LEFT); |
intrinseca | 1:b3907b8d9f65 | 104 | lcd->putc(BOTTOM); |
intrinseca | 1:b3907b8d9f65 | 105 | lcd->putc(BOTTOM_RIGHT); |
intrinseca | 1:b3907b8d9f65 | 106 | break; |
intrinseca | 1:b3907b8d9f65 | 107 | default: |
intrinseca | 1:b3907b8d9f65 | 108 | lcd->locate(position, 0); |
intrinseca | 1:b3907b8d9f65 | 109 | lcd->putc(BLANK); |
intrinseca | 1:b3907b8d9f65 | 110 | lcd->putc(BLANK); |
intrinseca | 1:b3907b8d9f65 | 111 | lcd->putc(BLANK); |
intrinseca | 1:b3907b8d9f65 | 112 | lcd->locate(position, 1); |
intrinseca | 1:b3907b8d9f65 | 113 | lcd->putc(BLANK); |
intrinseca | 1:b3907b8d9f65 | 114 | lcd->putc(BLANK); |
intrinseca | 1:b3907b8d9f65 | 115 | lcd->putc(BLANK); |
intrinseca | 1:b3907b8d9f65 | 116 | break; |
intrinseca | 1:b3907b8d9f65 | 117 | } |
intrinseca | 1:b3907b8d9f65 | 118 | } |