Results 1 to 5 of 5

Thread: E1.31 coding help required

  1. #1
    Join Date
    Dec 2011
    Posts
    5,882
    Post Thanks / Like

    Default E1.31 coding help required

    I would like to eliminate the need for external hardware if possible and have the val = Read
    to Read a specific pixel channel's state from the stream the Wemos is receiving . ( which I have no clue where to start - read from buffer ?)
    Without getting to complex , I am hoping someone can point me in the right direction to use the first 2 pixels or specifically channel 3 and channel 5 within the Wemos received code rather than having to add pixel boards .
    I hope this makes sense .
    Any help would be great .
    Cheers

    Code:
    int val = analogRead(#);
    if (val= X ) { 
    Do this

  2. #2
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,397
    Post Thanks / Like

    Default Re: E1.31 coding help required

    Hi, have a look at this thread
    http://doityourselfchristmas.com/for...ips-amp-floods
    Post #5 should do what you need & note post #10 that the Wemos analog out is a 10 bit (1023) value not 8 bit (255) as E1.31 is sent.

    Let me know if you need any help with this.

  3. #3
    Join Date
    Dec 2011
    Posts
    5,882
    Post Thanks / Like

    Default Re: E1.31 coding help required

    Thank you Barnabybear , you are a star !
    I had forgotten that you were mastering the e131 .

    One question from a quick look at post #10 , about the analogW in relation to your code .
    I am not certain I require the *4 as my thinking is to route the output directly to an input .
    Or am I thinking this wrong .
    I was hoping to achieve it all in code rather than spend GPIO , but if need be I will just config the output
    as you have done and route it back for my code to analogRead .
    I hope I am interpreting this right .

    Code:
    analogWrite(output_1_red, (e131.data[channel_1_red -1] *4)); // does this factor x 4
    Last edited by angus40; 08-21-2019 at 03:52 PM.

  4. #4
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,397
    Post Thanks / Like

    Default Re: E1.31 coding help required

    Quote Originally Posted by angus40 View Post
    Thank you Barnabybear , you are a star !
    I had forgotten that you were mastering the e131 .

    One question from a quick look at post #10 , about the analogW in relation to you code .

    Code:
    analogWrite(output_1_red, (e131.data[channel_1_red -1] *4)); // does this factor x 4
    
    analogWrite(output_1_red, (e131.data[channel_1_red -1] / 4)); // should it be divide 4 for 255 ?
    Hi, AnalogWrite on the ESP8266 is a value between 0 and 1023. The maximum value that can be transmitted via E1.31 is 255. If you did AnalogWrite(output_pin, 255) you will only get a duty cycle of 25%. AnalogWrite(output_pin, 255*4) fixes this and gives a duty cycle of 100% (1020/1023% to be accurate).

  5. #5
    Join Date
    Dec 2011
    Posts
    5,882
    Post Thanks / Like

    Default Re: E1.31 coding help required

    Thank you for the clarity and Quick reply .
    I will look into further .

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •