Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wire.h> //i2c dev scan
- // include the library code:
- #include <Adafruit_LiquidCrystal.h>
- #include <strings.h>
- Adafruit_LiquidCrystal lcd(0);
- char *text={""};
- //upside down char glyphs... default characters are 7x5 1 px on the bottom space
- byte uA[8] = { B00000, B10001, B10001, B10001, B11111, B10001, B10001, B01110};
- byte uB[8] = { B00000, B01111, B10001, B10001, B01111, B10001, B10001, B01111};
- byte uC[8] = { B00000, B01110, B10001, B00001, B00001, B00001, B10001, B01110};
- byte uD[8] = { B00000, B00111, B01001, B10001, B10001, B10001, B01001, B00111};
- byte uE[8] = { B00000, B11111, B00001, B00001, B01111, B00001, B00001, B11111};
- byte uF[8] = { B00000, B00001, B00001, B00001, B01111, B00001, B00001, B11111};
- byte uG[8] = { B00000, B11110, B10001, B10001, B11101, B00001, B10001, B01110};
- byte uH[8] = { B00000, B10001, B10001, B10001, B11111, B10001, B10001, B10001};
- byte uI[8] = { B00000, B01110, B00100, B00100, B00100, B00100, B00100, B01110};
- byte uJ[8] = { B00000, B00110, B01001, B01000, B01000, B01000, B01000, B11100};
- byte uK[8] = { B00000, B10001, B01001, B00101, B00011, B00101, B01001, B10001};
- byte uL[8] = { B00000, B01111, B00001, B00001, B00001, B00001, B00001, B00001};
- byte uM[8] = { B00000, B10001, B10001, B10001, B10101, B10101, B11011, B10001};
- byte uN[8] = { B00000, B10001, B10001, B11001, B10101, B10011, B10001, B10001};
- byte uO[8] = { B00000, B01110, B10001, B10001, B10001, B10001, B10001, B01110};
- byte uP[8] = { B00000, B00001, B00001, B00001, B01111, B10001, B10001, B01111};
- byte uQ[8] = { B00000, B10110, B01001, B10101, B10001, B10001, B10001, B01110};
- byte uR[8] = { B00000, B10001, B01001, B00101, B01111, B10001, B10001, B01111};
- byte uS[8] = { B00000, B01111, B10000, B10000, B01110, B00001, B00001, B11110};
- byte uT[8] = { B00000, B00100, B00100, B00100, B00100, B00100, B00100, B11111};
- byte uU[8] = { B00000, B01110, B10001, B10001, B10001, B10001, B10001, B10001};
- byte uV[8] = { B00000, B00100, B01010, B10001, B10001, B10001, B10001, B10001};
- byte uW[8] = { B00000, B01010, B10101, B10101, B10101, B10001, B10001, B10001};
- byte uX[8] = { B00000, B10001, B10001, B01010, B00100, B01010, B10001, B10001};
- byte uY[8] = { B00000, B00100, B00100, B00100, B01010, B10001, B10001, B10001};
- byte uZ[8] = { B00000, B11111, B00001, B00010, B00100, B01000, B10000, B11111};
- //pockets
- byte cornerA[]={B11111,B10000,B10000,B10000,B10000,B10000,B10000,B10000};//top left
- byte cornerB[]={B10000,B10000,B10000,B10000,B10000,B10000,B10000,B11111};//btm left
- byte cornerC[]={B11111,B00001,B00001,B00001,B00001,B00001,B00001,B00001};//top right
- byte cornerD[]={B00001,B00001,B00001,B00001,B00001,B00001,B00001,B11111};//btm right
- void flip(char *text);
- void setup() {
- Serial.begin(9600);
- lcd.begin(16,2); //
- //flipped characters
- lcd.createChar(0,uA);
- lcd.createChar(1,uB);
- lcd.createChar(2,uC);
- lcd.createChar(3,uD);
- lcd.createChar(4,uE);
- lcd.createChar(5,uF);
- lcd.createChar(6,uG);
- lcd.createChar(7,uH);
- lcd.createChar(8,uI);
- lcd.createChar(9,uJ);
- lcd.createChar(10,uK);
- lcd.createChar(11,uL);
- lcd.createChar(12,uM);
- lcd.createChar(13,uN);
- lcd.createChar(14,uO);
- lcd.createChar(15,uP);
- //lcd.createChar(16,uQ);
- //lcd.createChar(17,uR);
- //lcd.createChar(18,uS);
- //lcd.createChar(19,uT);
- //lcd.createChar(20,uU);
- //lcd.createChar(21,uV);
- //lcd.createChar(22,uW);
- //lcd.createChar(23,uX);
- //lcd.createChar(24,uY);
- //lcd.createChar(25,uZ);
- //lcd.createChar(26,cornerA);
- //lcd.createChar(27,cornerB);
- //lcd.createChar(28,cornerC);
- //lcd.createChar(29,cornerD);
- //ascii coversion prolly like n+66
- //setCursor be like: (column, row) 16 cols, 2 rows, both start at 0
- text="WTF";
- // lcd.setCursor(0,0);
- // flip(text); // lcd.write(1);
- }
- void loop() {
- //lcd.setCursor(16,0);
- for (int i=0; i<16;i++){
- lcd.write(i);
- lcd.setCursor(i,0);
- delay (900);
- }
- }
- void flip(char *text){
- Serial.println(text);
- char *tmp=atoi(text);
- int i = strlen(tmp);
- lcd.write(25);
- Serial.println(tmp[1]);
- }
Add Comment
Please, Sign In to add comment