Shop OBEX P1 Docs P2 Docs Learn Events
DMX Input for p2 — Parallax Forums

DMX Input for p2

Hello,

I don't see a DMX input object (Is that what they are still called in p2?)
Is it possible to port P1 objects to P2?

Is anyone working on a DMX input for the P2 before I dive into it?

Thanks,
Marcus

Comments

  • I am. If you're not in a rush I can do it for you. I already have DMX out for the P2. I've been doing DMX in and out on the P1 for a long time.

  • Hey Jon, thank you!

    Speaking of you working on your own, where is your gold mine of quality objects hiding? I see none in the "new" Obex.

    Thanks,
    Marcus

  • Oh yes, I meant for the P1 (since I grabbed a P1 to use for the DMX project)

    I don’t see any of the jm_ objects in the p1 repository

  • PublisonPublison Posts: 12,366
    edited 2021-03-09 12:39

    Here's a collection of Jon's P1 files.

  • JonnyMacJonnyMac Posts: 9,102
    edited 2021-03-09 14:29

    In case it's not in the archive Jim posted, here's my DMX input for the P1. As you can see, it takes advantage of the both timers in the cog, hence this has to be handled differently in the P2.

  • PublisonPublison Posts: 12,366
    edited 2021-03-09 20:23

    Here is Jon's Nuts and Volts article.

  • Hey JonnyMac,

    I'm still trying to get the DMX output on my p1 to work, for some reason I'm at a loss. I'm only able to get 1 single packet to output right after boot up, but then the line just remains high. I can't find an example of using the dmx_out object, so I'm not sure if I'm using it correctly. I've tried (2) different Prop1s and different pins without success. The Serial debugger is working, so I know the prop is ticking along.

    I've attached my example if anyone wants to take a look.

    I appreciate it.

    Thanks,
    Marcus

  • JonnyMacJonnyMac Posts: 9,102
    edited 2021-03-23 07:30

    Well... your debug setup seems a bit convoluted; I would start by simplifying that. That attached demo uses an updated version of the driver. A significant change is moving the DMX buffer from the object to the parent so that it can be sized as needed (I frequently do projects with a small universe, and I haven't found any fixture that has a problem with it).

    Your first loop writes the level 13 to slots 0 (the start byte) to 255. This is probably confusing your fixture because DMX fixtures expect a start byte of $00. If you meant to write that level to slot 13, you need to reverse the parameters; the first parameter is the slot (1..512, the second is the level 0..255). It even says so in the object documentation. :D

    pub write(slot, level)
    
    '' Writes level to slot (0 - 512)
    '' -- slot 0 is DMX start byte
    '' -- slot 1 to slot N are slot values (DMX levels)
    
      if ((slot => 0) & (slot =< 512))                              ' valid slot?
        dmxbuf[slot] := (0 #> level <# 255)                         ' set it 
    
  • Hey JonnyMac,

    Thanks for the response!

    I'm not sure what you mean about the convoluted debug setup. It seems to work well for me, as I've been using that method for a very long time.

    I have switched over to using the new version of dmx_tx that you have provided in your previous response. It works! Now it outputs DMX continuously. Unfortunately I was not able to update values with the "write" method. But if I manipulate the buffer directly from my top level object, things seem to work ok.

    Thanks again for the help!
    -Marcus

  • JonnyMacJonnyMac Posts: 9,102
    edited 2021-03-23 18:18

    Unfortunately I was not able to update values with the "write" method.

    Hmmm... I will have a look at that. I tend to do direct buffer manipulation, too, so I may have missed a "gotcha."

    A few minutes later...

    Well, darn. I looks like I fouled an operator on a beautification pass -- silly me. Could you help me by verifying the attached file? I've got another project on my desk at the moment. Thanks.

  • Hey @JonnyMac ,

    Any update on the jm_dmx_rx project you were (are) working on?

    I'm still interested :)

    Thanks,
    Marcus

  • It looks like I finished but didn't do clean-up. I'm at a convention this weekend -- I will have a lot and test when I get back.

  • Ooh, sounds fun!

    When you’re back, let me know if you need any help testing.

    Thanks,
    Marcus

Sign In or Register to comment.