Graphics on ESP8266

Posted on
  • Hi Everyone,

    Is anyone knows how to display on Max7291?

    I am trying to create a Graphics buffer as mentioned on

    espruino.com/MAX7219

    var g = Graphics.createArrayBuffer(8,8,1); // Create graphics
    

    But getting an "Uncaught Reference" error :(

    Can anyone help?

    Thanks
    Navas

  • Ok, I figured 1v91 doesn't have Graphics library inbuilt, so I had to use 1v86.171.

    Now, the following example doesn't display "Hi" rather it displays some weird characters on the display. Any idea?

    goo.gl/photos/8qLAqh571H3u8rTH6

    var SPI2 = new SPI();
    SPI2.setup({mosi:D0, sck:D2});
    var disp = require("MAX7219").connect(SPI2, D3);
    
    var g = Graphics.createArrayBuffer(8,8,1); // Create graphics
    g.flip = function() { disp.raw(g.buffer); }; // To send to the display
    
    g.drawString("Hi");
    g.flip(); // update what's on the display
    
  • or download 1v91 with Graphics 512K or 4MB

  • @MaBe
    I am using esp-01 upgraded version (1MB), Do you have a version which I can flash?

    Thanks
    Navas

  • you can use the 512K version

  • Thanks, I will give it a try.

    @MaBe, did you see the image? Do you have any idea what is causing this problem?

  • @navas, try changing the baud rate, I think the default is 50,000.

    Try 100,000

  • @navas how will you use in the esp-01 it only has 2 gpio pins?

  • @MaBe, I tried flashing the 512KB version, but it didn't work. Getting continuous message like this

    rl.l|.là|.....lì.b|.ì.rb.bònnlnnâì.b.pìl­rlrlpònà.....l......b.nâ|.lìlbònnî.ll`..­.nn..l..nrn...ll`.pònà....râà....b.nâ|.ì­bònnî..l`...nn..l..nrn...l`.pònà....râàì­...b.nâ|.l.bònnî..l`...nn.l`...nrn..r.l`­..rn..r.l`.rlnònnâr.nnn.lbbplb.l..ì.lì..­.......lll~rl..ì.lllnâ........lll.l..ì.l­nà.nìn~..llàb..llpb.brìl`nlpìl`bl`.ln..n­ânl|.b....l...l
    

    So I had to revert to the 1v86.171 version. This is the command I have used

    esptool.py --port /dev/tty.SLAB_USBtoUART --baud 115200 write_flash   --flash_freq 40m --flash_mode qio --flash_size 8m   0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 0xFC000 esp_init_data_default.bin 0x1FC000 blank.bin
    
  • @Wilberforce, Once you setup the Wifi I can use ESP-01, RX / TX pins. They are simple connected to D3 and D1, please check the following image

    take.ms/wEC8B

  • Hi @navas,

    first erase the flash and then use the flash setting for 512KB listed in README_flash.txt

         _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
                  |_| http://espruino.com
     1v91.2149 Copyright 2016 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 512KB:256/256, manuf 0xe0 chip 0x4016
    WARNING: *** Your flash chip does not match your flash map ***
    > 
    

    you can ignore the warning, but you should seriously think about a donation

  • you can ignore the warning, but you should seriously think about a donation

    I would love too! How do I a do it. I have a paypal account.

    Thanks
    Navas

  • espruino.com/Donate and click on the donate button - it offers PayPal too

  • @Gordon Just placed an order for pico from official tindie, order # 64437.

    take.ms/WuHIh

    Also donated $5 with paypal. Confirmation number: 8GF29176FL1303242

    I am not making any money using Espruino / ESP8266. I am just a hobbyist. :)

    But I love working with Espruino on my spare time. It makes myself alive. I love this community and thanks for doing this great work!

    Espruino Rocks!

  • @Wilberforce changed the baud rate. No luck yet!

    I guess it is best suitable for numbers and HELP!

  • @navas
    Sorry - I was not clear. Not the connection baud rate, the SPI baud rate to connect to your LCD module:

    espruino.com/Reference#l_SPI_­setup

    SPI2.setup({mosi:D0, sck:D2,baud:100000});
    
  • @Wilberforce,

    Yes, I did try exactly what you have mentioned, but no luck so far...

  • I think the debug output will use one the D2. You would need to disable both the uart and the debug uart - as the serial output could be upsetting your spi output

  • try this pins

    // NodeMCU ESP8266
    SPI1.setup({sck:NodeMCU.D5,mosi:NodeMCU.­D7,baud:100000});
    
    // Native ESP8266
    SPI1.setup({sck:D14,mosi:D13,baud:100000­});
    
    
  • He is using an esp-01 so won't have those pins!

  • Sorry - shame .....

  • Nope, tried with ESP-12E as well. Ended up with the same result.

    But thanks for the response, appreciate it.

  • The NodeMcu:Dx notation that @MaBe referenced maps to the PIN numbers as labelled on the board.

    If you use D0 this is gpio0 , and not the PIN label on the board...

    Do you understand what I'm trying to say?

  • Yes, I understand that. I am not using node MCU notation, just plain 12E. Also I see that displaying "--HELP--" and numbers works just fine. But with Graphics I couldn't get it work.

    Thanks for the response.

  • ok . so you can write text and numbers to the display.

    It is not clear what you actual issue is. What graphics are you trying to display?

    If you posted some code, perhaps it would be apparent what you are trying to do?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Graphics on ESP8266

Posted by Avatar for navas @navas

Actions