Let's play with Deuligne : Custom characters

Let's play with Deuligne : Custom characters

Message non lude Lionel » Ven 28 Oct 2011 09:58

Let's play with...

Image

When shield Deuligne assembly is finished and library installed, it's time to try some funny sketches (there is a bunch of examples in the library, do not hesitate to try them all !)

Custom characters creation :

    Hardware used :
    deuligne... obviously
    arduino... (see previous comment)

    Liquid crystal displays used on the "Deuligne" shield are able to keep 8 custom characters in their internal memory.

    As an example today, I'll integrate the Snootlab logo (in fact an hardly pixelated version) inside text.

    First of all, we need to create the custom characters used for the logo.
    To do this, there is a wonderful tool created for the Liquid Crystal Display library.
    http://icontexto.com/charactercreator/

    Tick or untick the boxes to design the logo et the character code (red outerlined) is real time updated.

Image
    We've to create the logo second part...

    Copy and paste the characters code and insert it in dedicated sketch.

    Code: Tout sélectionner
    #include "Wire.h" // I2C library insertion (needed)
    #include <Deuligne.h> // Deuligne library insertion (needed)

    Deuligne lcd; // lcd object declaration

    // Custom characters code
    byte left[8] = {
       B00010,
       B10110,
       B11111,
       B11111,
       B10001,
       B10101,
       B10001,
       B01110
    };
    byte right[8] = {
       B00100,
       B01101,
       B11111,
       B11111,
       B10001,
       B10101,
       B10001,
       B01110
    };

    void setup() {
      Wire.begin(); // I2C init (needed)
      lcd.init(); // LCD init (needed)
      lcd.createChar(0, left); // left character creation and assign it to 0
      lcd.createChar(1, right); // right character creation and assign it to 1
      lcd.backLight(true); // Backlight is on
      lcd.setCursor(0, 0); // Set cursor to 0,0 (1ere ligne, 1er caractere)
      lcd.print("Sn"); // Print the text beginning
      lcd.setCursor(2,0); // Set cursor just after the text
      lcd.write(0); // and write the character 0 (left side of the logo)
      lcd.setCursor(3,0); // Set cursor just after
      lcd.write(1); // write the character 1 (right side of the logo)
      lcd.setCursor(4, 0); // Set cursor just after again
      lcd.print("tlab"); // to finish to write the text
      lcd.setCursor(4, 1); // ok, it's under control now
      lcd.print("Le Deuligne"); // I can stop to comment...
    }

    void loop() {}


    Now, you just have to compile, upload and.... go !!!

    Image

    More examples to come, stay tuned !!!
Image - Distributeur officiel Arduino - Conception de shields
Avatar de l’utilisateur
Lionel
 
Messages: 734
Inscription: Mar 21 Déc 2010 09:52
Localisation: Toulouse

Retourner vers Support for Snootlab Products

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité

cron