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