نمایش نتایج: از 1 به 3 از 3

موضوع: ساخت فونت برای lcd

  1. #1
    Junior Member
    تاریخ عضویت
    Jun 2017
    محل سکونت
    ایران
    نوشته ها
    5

    Arrow ساخت فونت برای lcd

    سلام

    من میخوام یه lcd 2*16 رو با فونتی که خودم درست کرده باشم برنامه نویسی کنم .
    نرم افزار GLCD Font Creator رو دانلود کردم و یه پک فونت 4 تایی درست کردم و سیوش کردم یه فایل شد با پسوند (فرمت ) lcd. الان باید این فایل رو چیکار کنم ؟

    توی اینترنت گشتم و یک کد شبیه به چیزی که میخوام پیدا کردم
    کد:
    /* in the name of god
     
     Made by Michael Pilcher at 2/9/2010
     Edited at 2017
     
     */
    
    // include the library
    #include <LiquidCrystal.h>
    
    // initialize the interface pins
    LiquidCrystal lcd(12,11,5,4,3,2);
    int x = 0;
    // the 8 arrays that form each segment of the custom numbers
    byte LT[8] = 
    {
      B00111,
      B01111,
      B11111,
      B11111,
      B11111,
      B11111,
      B11111,
      B11111
    };
    byte UB[8] =
    {
      B11111,
      B11111,
      B11111,
      B00000,
      B00000,
      B00000,
      B00000,
      B00000
    };
    byte RT[8] =
    {
      B11100,
      B11110,
      B11111,
      B11111,
      B11111,
      B11111,
      B11111,
      B11111
    };
    byte LL[8] =
    {
      B11111,
      B11111,
      B11111,
      B11111,
      B11111,
      B11111,
      B01111,
      B00111
    };
    byte LB[8] =
    {
      B00000,
      B00000,
      B00000,
      B00000,
      B00000,
      B11111,
      B11111,
      B11111
    };
    byte LR[8] =
    {
      B11111,
      B11111,
      B11111,
      B11111,
      B11111,
      B11111,
      B11110,
      B11100
    };
    byte UMB[8] =
    {
      B11111,
      B11111,
      B11111,
      B00000,
      B00000,
      B00000,
      B11111,
      B11111
    };
    byte LMB[8] =
    {
      B11111,
      B00000,
      B00000,
      B00000,
      B00000,
      B11111,
      B11111,
      B11111
    };
    
    
    
    void setup()
    {
      // assignes each segment a write number
      lcd.createChar(8,LT);
      lcd.createChar(1,UB);
      lcd.createChar(2,RT);
      lcd.createChar(3,LL);
      lcd.createChar(4,LB);
      lcd.createChar(5,LR);
      lcd.createChar(6,UMB);
      lcd.createChar(7,LMB);
    
      // sets the LCD's rows and colums:
      lcd.begin(0, 2);
    
    }
    
    void custom0O()
    { // uses segments to build the number 0
      lcd.setCursor(x, 0); 
      lcd.write(8);  
      lcd.write(1); 
      lcd.write(2);
      lcd.setCursor(x, 1); 
      lcd.write(3);  
      lcd.write(4);  
      lcd.write(5);
    }
    
    void custom1()
    {
      lcd.setCursor(x,0);
      lcd.write(1);
      lcd.write(2);
      lcd.setCursor(x+1,1);
      lcd.write(255);
    }
    
    void custom2()
    {
      lcd.setCursor(x,0);
      lcd.write(6);
      lcd.write(6);
      lcd.write(2);
      lcd.setCursor(x, 1);
      lcd.write(3);
      lcd.write(7);
      lcd.write(7);
    }
    
    void custom3()
    {
      lcd.setCursor(x,0);
      lcd.write(6);
      lcd.write(6);
      lcd.write(2);
      lcd.setCursor(x, 1);
      lcd.write(7);
      lcd.write(7);
      lcd.write(5); 
    }
    
    void custom4()
    {
      lcd.setCursor(x,0);
      lcd.write(3);
      lcd.write(4);
      lcd.write(2);
      lcd.setCursor(x+2, 1);
      lcd.write(255);
    }
    
    void custom5()
    {
      lcd.setCursor(x,0);
      lcd.write(255);
      lcd.write(6);
      lcd.write(6);
      lcd.setCursor(x, 1);
      lcd.write(7);
      lcd.write(7);
      lcd.write(5);
    }
    
    void custom6()
    {
      lcd.setCursor(x,0);
      lcd.write(8);
      lcd.write(6);
      lcd.write(6);
      lcd.setCursor(x, 1);
      lcd.write(3);
      lcd.write(7);
      lcd.write(5);
    }
    
    void custom7()
    {
      lcd.setCursor(x,0);
      lcd.write(1);
      lcd.write(1);
      lcd.write(2);
      lcd.setCursor(x+1, 1);
      lcd.write(8);
    }
    
    void custom8()
    {
      lcd.setCursor(x,0);
      lcd.write(8);
      lcd.write(6);
      lcd.write(2);
      lcd.setCursor(x, 1);
      lcd.write(3);
      lcd.write(7);
      lcd.write(5);
    }
    
    void custom9()
    {
      lcd.setCursor(x,0);
      lcd.write(8);
      lcd.write(6);
      lcd.write(2);
      lcd.setCursor(x+2, 1);
      lcd.write(255);
    }
    
    
    
    
    
    
    
    void numbers()
    {
      custom0O();    // displays custom 0 on the LCD
      x = x + 4;    // sifts cursor over 4 columns
      custom1();
      x = x + 4;
      custom2();
      x = x + 4;
      custom3();
      x = x + 4;
      custom4();
      x = x + 4;
      custom5();
      x = x + 4;
      custom6();
      x = x + 4;
      custom7();
      x = x + 4;
      custom8();
      x = x + 4;
      custom9();
      delay(500);
    }
    
    
    
    void loop()
    {
    
      numbers();
      for (int positionCounter = 0; positionCounter < 24; positionCounter++) {
        lcd.scrollDisplayLeft(); 
        delay(500);
      }
      x = 0;
      lcd.clear();
      delay(500);
    }

    ولی برای برنامه نویسی با این کد برای هر کارکتر ( حرف یا عدد ) باید یه فونت باینری درست کنی.

    کتابخانه آماده هست مثل پیش فرض خود آردوینو که فونت انگلیسی خوبی داشته باشه یا زبان عربی رو ساپورت کنه ؟
    ویرایش توسط mehdijjc : 07-03-2017 در ساعت 07:29 PM
    TELEGRAM_mehdijjc

  2. #2
    Junior Member
    تاریخ عضویت
    Jun 2017
    محل سکونت
    ایران
    نوشته ها
    5
    کسی راه حلی سراغ نداره ؟؟؟
    TELEGRAM_mehdijjc

  3. #3
    Junior Member
    تاریخ عضویت
    Jun 2017
    محل سکونت
    ایران
    نوشته ها
    5
    لطفا یه راه حل بهم بگید.
    TELEGRAM_mehdijjc

کلمات کلیدی این موضوع

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •  

SEO by vBSEO