Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. zitrone
    Z
    • Continue chat with zitrone
    • Start new chat with zitrone
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    zitrone

    @zitrone

    0
    Reputation
    4
    Posts
    331
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    zitrone Follow

    Posts made by zitrone

    • RE: M5Paper : Usage of canvas.setTextColor() to define different grey scales.

      @felmue Thank you for the explanation and the link :)

      posted in Arduino
      Z
      zitrone
    • M5Paper : Usage of canvas.setTextColor() to define different grey scales.

      Hi,
      I have a basic question arising from lack of examples.

      I am referring to
      https://docs.m5stack.com/en/api/m5paper/epd_canvas
      in order to set different grey scales for text on a canvas.

      I tried values from 0 to 15, 0x00, 0x0F, 0xFF and so on and found only 3 grey shades working.
      Can someone please specify which are the different values to be passed in as the first argument to canvas.setTextColor() in order to achieve the 16 different grey scale variants?

      Thanks,
      Zitrone

      posted in Arduino
      Z
      zitrone
    • RE: M5 Paper : Unable to clear screen contents

      @felmue Thank you for the quick reply.
      Yes, it works perfectly. :)

      posted in Arduino
      Z
      zitrone
    • M5 Paper : Unable to clear screen contents

      Hi folks,

      I just started using M5 paper and went through the documentation at
      https://docs.m5stack.com/en/api/m5paper/epd_canvas

      Using this info, I created a canvas with some content in the setup.
      Then, in the loop I wish to clear the canvas and display some other content.
      The code is as follows :

      #include <M5EPD.h>
      M5EPD_Canvas canvas(&M5.EPD);
      void setup() {
      M5.begin(); //Init M5Paper.
      M5.EPD.SetRotation(90); //Set the rotation of the display.
      M5.EPD.Clear(true); //Clear the screen.
      M5.RTC.begin(); //Init the RTC.

      canvas.createCanvas(540, 960); //Create a canvas.
      canvas.setTextSize(3); //Set the text size.
      canvas.drawString("Hello World", 10, 10); //Draw a string.
      canvas.pushCanvas(0,0,UPDATE_MODE_DU4); //Update the screen.
      delay(2000);
      }

      void loop() {
      M5.EPD.Clear(true); //Clear the screen.
      canvas.drawString("Another string", 10, 60); //Draw a string.
      canvas.pushCanvas(0,0,UPDATE_MODE_DU4); //Update the screen.
      delay(5000);
      }

      Expected : I see only 'Another string' after refresh every 5 seconds.
      Actual : Both 'Hello World' and 'Another string' are displayed.
      :(

      I think I am missing something. May you please explain what is going wrong here?

      Thanks,
      Zitrone

      posted in Arduino
      Z
      zitrone