🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5Dial and Canvas in Lcd module

    Scheduled Pinned Locked Moved Micropython
    micropython
    5 Posts 2 Posters 4.9k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      Microbug
      last edited by

      Hello,

      I'm trying to use the Canvas in Micropython and can't get things working.

      from M5 import Lcd
      toto=Lcd.newCanvas(60,50)
      print(toto.width(),toto.height())
      toto.fillCircle(x=10,y=10,r=5,color=0xffffff) # centre
      toto.push(0,0)

      This does not display anything :/

      I see that newCanvas can accept up to 4 arguments but can't find their signification.

      Any help ?

      Thansk !

      1 Reply Last reply Reply Quote 0
      • felmueF Offline
        felmue
        last edited by felmue

        Hello @Microbug

        it looks like the circle is in the invisible upper left corner of the round display. Moving it helps. Try this:

          from M5 import Lcd
          Lcd.clear() # added
          toto=Lcd.newCanvas(60,50)
          print(toto.width(),toto.height())
          toto.fillCircle(x=50,y=40,r=5,color=0xffffff) # modified
          toto.push(0,0)
        

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • M Offline
          Microbug
          last edited by

          omg , I feel so stupid !

          Many thanks !

          Any idea for the 2 more parameters on newCanvas ?

          1 Reply Last reply Reply Quote 0
          • felmueF Offline
            felmue
            last edited by

            Hello @Microbug

            it looks like bits per pixel (bbp) and whether device has PSRAM or not. See here and here.

            Thanks
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            M 1 Reply Last reply Reply Quote 0
            • M Offline
              Microbug @felmue
              last edited by

              @felmue many thanks !

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post