Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. BrianR
    3. Topics
    B
    • Continue chat with BrianR
    • Start new chat with BrianR
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by BrianR

    • B

      Simulate button press?
      Cores • • BrianR

      5
      0
      Votes
      5
      Posts
      6920
      Views

      B

      Well, I have a couple of spots in my project that a button press would make things very easy. For example, I'm using M5ez for my interface, and use Blynk to display events on the M5 screen. I have backlight timeout set to 30 seconds. A new event doesn't turn the backlight back on, but a keypress does. So, in my if (newEvent) loop, I could have a M5.BtnA.press(), that would wake up the screen. Can I go into the M5ez library, figure out what happens after a real button press to wake the screen and replicate that? Yes, of course, and I have certainly tried that, but some of the items that need to be set are private, so calling them from a main loop is problematic. Rewriting that stuff so it's all public might work, but that solves one problem. I'd also like menus to time out - if there's no activity after going into a menu, I'd like it to time out and go back to the main menu. Again, code can certainly make that happen, but a M5.BtnA.press() would be a lot easier to implement... Does this make sense?
    • B

      M5ez scrolling through lines on canvas?
      PRODUCTS • • BrianR

      3
      0
      Votes
      3
      Posts
      5233
      Views

      B

      Have the ezTimeLog example loaded up. It is printing lines at the bottom of the canvas, and shifting previously printed lines up, indeed just like a terminal screen watching serial output. I think I misunderstood the scrolling functionality as the ability to use buttons to go back through the history at the top that had already scrolled off the screen. I see in issue #24 you say "canvas.print creates a buffer in memory that stores every print until it has scrolled off the screen", so that's not the way it works - sorry for my confusion. Indeed, creating menu items that don't do anything would be a possible solution. I tried that early on, but found that once the menu was drawn (or run), it merely sits and waits for buttons. I have not tried creating a function that does an .addItem, then runs the menu again, and run that function with an .addEvent. I'll give that a try as soon as possible. Is there a limit to the number of menu items, other than memory constraints? If I'm successful getting the "menu" to redraw, I'll let you know, and I guess I'll see what the limits might be! Thanks so much, @rop, your work is very appreciated!!!