• Many Thanks @Gordon, it works great!
    I use it with DennisFont (cause i'm writing in french, have to had more chars, count until 255) with a height of height (arf)
    i keep line 4 to 34 and modifying as follow after

    require("FontDennis8").add(Graphics);
    
    function centre(text, y) {
      g.drawString(text, (g.getWidth() - g.stringWidth(text))/2, y);
    }
    
    function init() {
      g.clear();
      g.setFontDennis8();
      centre("en attendant",22);
      g.flip();
      doFont();
      g.clear();
      g.setColor(1);
      g.setFontDennis8();
      centre("en short",22);
      g.fillRect(10,0, g.getWidth()-20, 18);
      g.setColor(0);
      g.setFontCustom(charData, charFrom, charWidths, charHeight);
      centre("Ta m\xe8re",2);
      // affiche
      g.flip();
    }
    
    var g;
    function onInit() {
      // initialise l'écran oled
      I2C1.setup({scl:B6,sda:B7});
      g = require("SSD1306").connect(I2C1, init, { height : 32 });
    }
    
    

    regards

    éric


    1 Attachment

    • 2017-03-27 23.38.25.jpg
About

Avatar for Mrbbp @Mrbbp started