converting Problem

edited March 2016 in Python Mode

Hello, I am quite new to Processing, doing some Python for a while now. I am wondering how to convert a Processing sketch to Python mode. I am doing some DMX stuff with the dmxp512 library. Works on the Processing side very well. Converting the sketch is straight forward, only importing libraries and two lines give me some Problems.

Here is the code:

    import dmxP512.*;
    import processing.serial.*;

    DmxP512 dmxOutput;       // How to read and convert this line
    int universeSize = 512;

    String DMXPRO_PORT = "/dev/tty.usbserial-ENY46I7I";
    int DMXPRO_BAUDRATE = 115000;

    void setup() {  
      size(245, 245, JAVA2D);    
      dmxOutput = new DmxP512(this,universeSize,false);       // How to read and convert this line
      dmxOutput.setupDmxPro(DMXPRO_PORT,DMXPRO_BAUDRATE);    
    }

    void draw() {     
      background(0);
      dmxOutput.set(1,mouseX);
      dmxOutput.set(5,mouseY);
    }

Would be very thankful for some help with this. Cheers, Volker

Answers

  • Answer ✓

    Noob Question...;-)...I answered it myself...here is the code if someone is interested:

    add_library('dmxP512')
    add_library('serial')
    
    universeSize=512
    
    DMXPRO_PORT = "/dev/tty.usbserial-ENY46I7I"
    DMXPRO_BAUDRATE = 115000
    
    def setup():
        size(245, 245, JAVA2D)
        global dmxOutput
        dmxOutput=DmxP512(this,universeSize,False)
        dmxOutput.setupDmxPro(DMXPRO_PORT,DMXPRO_BAUDRATE)
    
    def draw():
        background(0)
        dmxOutput.set(1,mouseX)
        dmxOutput.set(5,mouseY)
    

    cheers, Volker

Sign In or Register to comment.