Navigation

    M5Stack Community

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

    frank26080115

    @frank26080115

    0
    Reputation
    5
    Posts
    81
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    frank26080115 Follow

    Posts made by frank26080115

    • IR LED seems to be always on, even freshly after a reboot

      I am using UIFlow v1.9.7

      This is weird. Point your phone's camera at the IR LED of a M5Stick or M5Stack that has the IR LED. Even just after a reboot, it seems to be glowing.

      I cannot use the built-in "ir" object because it implements NEC protocol, which is not what I need. I need to generate a 40KHz pulse train for SIRC protocol

      Taking manual control over the LED by deinitializing the RMT, I can turn off the pin using machine.Pin

      But after reinitializing RMT module, the LED starts to glow again.

      I am trying code that looks like

      >>> rmt.loop(True)
      >>> rmt.write_pulses([1, 100000], start=0) # this should make the LED dim
      

      and

      >>> rmt.loop(True)
      >>> rmt.write_pulses([1, 100000], start=1) # this should make the LED bright
      

      The weird thing is that one of these should make the LED appear off, or at least dim. The opposite snippet should make the LED appear very bright. This is not the case. I see no change in brightness

      What am I doing wrong?

      Has anybody successfully used the IR LED for anything? The MicroPython version implemented in UIFlow is extremely old and won't match the latest documentation, the best documentation is actually this particular commit in the official ESP32 port of MicroPython https://github.com/micropython/micropython/blob/1678f417445703750e187b1b8a83c8c3e0e3796f/ports/esp32/esp32_rmt.c

      oh and in case anybody needs to know, to deinitialize the RMT because you can't use the settings M5Stack is forcing upon you, I'm using this

              try:
                  ir.__dict__['_tx_encode']._rmt.deinit()
                  del ir.__dict__['_tx_encode']._rmt
                  del ir
              except:
                  pass
      
      posted in General
      F
      frank26080115
    • esp32.RMT constructor example is not accepting the tx_carrier parameter

      Look at the example code here https://docs.micropython.org/en/latest/library/esp32.html?highlight=rmt

      Specifically the line

      r = esp32.RMT(0, pin=Pin(18), clock_div=8, tx_carrier=(38000, 50, 1))
      

      it throws an exception

      TypeError: extra keyword arguments given
      

      removing the parameter tx_carrier will stop the exception, but I need it to have a 38KHz carrier frequency, that's the whole point of the IR LED

      How do I make the m5stick send out pulses with a 38KHz carrier frequency?

      Thanks

      PS yes I know it's pin 9 on m5stick

      PS I would say what micropython version I'm running but it's reporting as "798485f45-dirty"

      posted in Micropython
      F
      frank26080115
    • RE: How to see print() output and REPL from VSCode?

      Currently my solution is that I wrote software that tunnels data between a virtual serial port and a real one, while displaying it to me. It uses com0com to setup the fake serial port.

      Basically, m5stick is COM4, com0com is configured with fake COM6 and COM7. COM6 is connected to COM4 via my app and I can see the text in between them and inject keystroke too. VSCode talks with COM7 and all of the data from COM7 goes to COM6, to my screen, then to COM4

      I also coded it so if I hit ESC, it sends the CTRL-C signal to the terminal so it brings up REPL. (pressing CTRL-C will quit the whole terminal lol)

      This solution still sucks, exceptions are still printed to the LCD instead of to the COM port

      posted in Micropython
      F
      frank26080115
    • RE: How to see print() output and REPL from VSCode?

      @robalstona said in How to see print() output and REPL from VSCode?:

      Try this extension
      https://marketplace.visualstudio.com/items?itemName=curdeveryday.vscode-m5stack-mpy

      Thanks I have already installed that. Where in that extension can you see serial port print output while simultaneously being able to access the files?

      posted in Micropython
      F
      frank26080115
    • How to see print() output and REPL from VSCode?

      I followed all the instructions to install VSCode on Windows, and the M5Stack plugin for VSCode, I am able to blink the LED on my M5Stick-C so far.

      How can I view the outputs of my print statements?

      How can I use the MicroPython REPL?

      The "OUTPUT" tab of VSCode is always blank, and none of these options shows me the REPL or serial print output

      0_1653536864625_b9ffe56b-4a5c-4a58-907c-390c4a5995a3-image.png

      The "TERMINAL" tab is always showing me Windows Powershell

      When VSCode is connected to the M5Stick, no other serial port terminal program (such as Putty, TeraTerm, RealTerm, etc) is able to access the COM port. I cannot just run some sort of command line serial port terminal through Powershell since the port is occupied

      If I disconnect VSCode, I get the error 0_1653536701744_1b8925ae-9caf-49e5-83f9-587e178273cd-image.png , so disconnecting to use an external terminal app is not an option

      I feel like I am missing something obvious... Please help me view my print output from within VSCode without disconnecting the COM port

      posted in Micropython
      F
      frank26080115