Navigation

    M5Stack Community

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

    BrianR

    @BrianR

    0
    Reputation
    7
    Posts
    1475
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    BrianR Follow

    Posts made by BrianR

    • RE: M5ez scrolling through lines on canvas?

      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!!!

      posted in PRODUCTS
      B
      BrianR
    • RE: Simulate button press?

      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?

      posted in Cores
      B
      BrianR
    • RE: Simulate button press?

      Yup, @heybin, you're indeed right. Short of soldering a wire from an available GPIO to the switch itself, I don't see anything in the buttons library that could even be modified to allows for this functionality. It's either so simple that I just can't see the answer, or impossible (without a soldering iron involved)...

      posted in Cores
      B
      BrianR
    • Simulate button press?

      Is there a way to simulate a button press in code? I'm looking for a M5.BtnA.press(). I've tried pulling GPIO pins low for a quick delay, then back high again, like this:

          digitalWrite(38, LOW);
          delay(100);
          digitalWrite(38, HIGH);
      

      Not only does that not work, I'm afraid I'd lose debouncing. Any ideas?

      posted in Cores
      B
      BrianR
    • M5ez scrolling through lines on canvas?

      @rop, I'm a little confused about scrolling contents printed to the screen. In the Github documentation of M5ez, under the heading "Printing to the canvas", it says that items printed to the canvas with ez.canvas.println will scroll. It could be the way I'm creating that submenu, or the buttons that I'm showing, but I don't see a way to scroll back up through those lines? In the Demo, printing to the canvas is in there, but merely shows an OK button and waits. How to create that menu, and have button A be an "up" button, B be an "OK", and C be a "down"? Is scrolling through those printed lines of text possible like that? I print events from Blynk to the canvas, it would be nice to be able to go back up to see more than what's on the screen... Thanks in advance!

      posted in PRODUCTS
      B
      BrianR
    • RE: M5ez, a complete interface builder system for the M5Stack as an Arduino library. Extremely easy to use.

      Ah yes, success! I added ez.addEvent(run_Blynk); to the setup(), and then created a function down below, after the loop, that looks like the following. It's worth noting that I'm using the M5 as a "receiver" from a bridge, thus the blynk_write(V1) statement.

      uint16_t run_Blynk() {
        Blynk.run();
        return 1;
      }
      
      BLYNK_WRITE(V1){
          eventData = param.asString();
      }
      

      That did the trick, Blynk connects and stays connected. Now trying to figure out how to display the dynamic data from Blynk on the canvas. If I figure this all out, I'll write a short demo in a new topic for others, as I haven't seen many examples of actual use of M5ez, other than the demo program, but most projects are more than just menus, they have to display something... Again, @rop, excellent work, and thanks again so much!

      posted in PROJECTS
      B
      BrianR
    • RE: M5ez, a complete interface builder system for the M5Stack as an Arduino library. Extremely easy to use.

      @rop, M5ez is awesome - thank you for the enormous amount of time you put into it!

      I'm trying to use Blynk to receive events from another board. I have gotten events to show on the M5 in a simple standalone program, so I know it "works". Within M5ez, I believe I just need to call Blynk.run() with the ez.addEvent function, as Blynk.run needs to run often as possible - in most of my projects it's usually the only thing in the main loop, but I'm unsure of how/where to use the ez.addEvent function. There aren't any examples of ez.addEvent in the Demo or any of the other examples included with the library. Any help on syntax and where to put that statement?

      Thanks again for your time!!!

      posted in PROJECTS
      B
      BrianR