Coder Social home page Coder Social logo

teensydmx's Introduction

Build Status

TeensyDmx

DMX Transmit and Receive for Teensy 3.x and Teensy-LC with RDM responder (client) and RDM controller support. It should support all of the serial interfaces on the devices.

This is the combination of DMXSerial2, DmxReceive and DmxSimple but converted to use the UART for Tx rather than the bit-banging method utilised by DmxSimple.

Limited testing has been done with the hardware people have lying around on Serial1, on Teensy 3.2, 3.5 and LC on Arduino IDE 1.8.2.

Teensy-LC Teensy 3.0 Teensy 3.1 Teensy 3.2 Teensy 3.5 Teensy 3.6
DMX Rx ✔️ ✔️ ✔️
DMX Tx ✔️ ✔️ ✔️
RDM Responder ✔️ ✔️ ✔️
RDM Controller ✔️

teensydmx's People

Contributors

chrisstaite avatar harryprayiv avatar peternewman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teensydmx's Issues

Trouble with changing values in the loop

I finally have a working test setup with this library and it definitely works.

However, it doesn't update whenever the arduino loops.

When the Teensy goes around the loop, the array values don't change no matter how much I try in my code. I am thinking that the array that temporarily holds the DMX values is either a constant instead of a variable or doesn't actually transfer new values into the buffer once it has them. I am not that great at this stuff so I will just post the example that I have been working on.

Another thing is the DMX REDE pin. I am not sure if I have it hooked up right. Is it the Read/Write enable switch for use with RDM so you can do both send and recieve? If so, I have tried both pin 2 and pin 24 and the code acts EXACTLy the same. I THINK I have REDE on 24, but I am not sure since it doesn't change anything anyway in my observations. Maybe the missing variable here IS my REDE pin (which your code seems to say is on pin 1 on the Teensy, which doesn't seem correct).

Here's my simplified code in an attempt to get at the heart of this matter more efficiently.

#include <TeensyDmx.h>

#define DMX_REDE 24



TeensyDmx Dmx(Serial1, DMX_REDE);

void setup() {
  analogReadRes(8);
  Dmx.setMode(TeensyDmx::DMX_OUT);

}

void loop() {
  uint8_t dmxVal[] = {analogRead(1)}; // this acts the same if you use bytes
  
  Dmx.setChannels(0,dmxVal,1);
  Dmx.loop(); // acts the same with or without this command
  //should I be somehow releasing the current DMX data here and refreshing it when it comes back around in the loop?  IF so, how...(and WHY  actually)?
}

DMX Personality Support

Hi all,

If anyone is interested, these code changes should apply to this repo fairly easily and I'm happy for someone to do so:
mathertel/DmxSerial2#39

I don't currently have a Teensy to hand otherwise...

Teensy LC not working

I've seen a Teensy LC transmit project, therefore I thought it could be possible to use a Teensy LC for receiving DMX, too.
It is compileable, but setting UART0_RWFIFO = 1; will fail immediatly, because Teensy LC does not have a Fifo. Uncommenting this line will lead to Dmx.setMode(TeensyDmx::DMX_IN); not hanging anymore.

But at receiving any data, it starts hanging once again, but I can't see why. Do you have an idea?

Teensy LC does not have IRQ_UART0_ERROR either. But as I can see, you already took care about it.

Pin details for example required

Hi,

I tried to get this working a little while ago, but couldn't get DMX Tx or Rx working, or RDM comms.

Can you confirm which pins need connecting to what etc please?

Need a way to not toggle a REDE pin when using for only input or output

The API assumes that we need to toggle a REDE pin for selecting input or output mode. For systems either without free pins or set up to only transmit or receive, a pin doesn't need to be toggled. I'm playing with different ways to do this cleanly, but maybe you've already thought of a good way.

m_uart.available() never returns a value > 0 for Teensy 3.1

In short, the most basic receive example doesn't receive bytes. m_uart.available() never seems to return a value > 0.

The code:

#include "TeensyDmx.h"

#define CHANNEL 0
#define LED_PIN 13

TeensyDmx dmx(Serial1);

void setup() {
  dmx.setMode(TeensyDmx::DMX_IN);
  pinMode(LED_PIN, OUTPUT);
}

void loop() {
  dmx.loop();
  if (dmx.newFrame()) {
    Serial.println(dmx.getBuffer()[CHANNEL]);
  }
}

I've instrumented TeensyDmx.cpp to set LED_PIN to HIGH inside readBytes() and inside the while loop.

System setup:

  1. Teensy 3.1.
  2. Pin 0 (Serial1) is receiving DMX input.
  3. Tested on an oscilloscope to make sure there's data.
  4. Tested with another, much simpler, home-rolled library; it can receive data. Exact same hardware setup.

The "simpler" library only sets up an error handler and not the full status handler, as if IRQ_UART0_ERROR were defined in TeensyDmx. I tried defining this as well, to use the alternative handler, but no luck there either.

Two Teensy 3.2 don't talk to each other

Hi,
I just tested your library on two Teensy 3.2 with Teensyduino 1.35. but sadly they can't talk to each other - the sender code from your example on it's own works, I tested it with a dimmer.
Do you have any ideas?
Thank you very much

DMX TIMEOUT

Disconnecting the DMX cable causes the led to freeze with the values of the last packet received. DMX serial and DMX Serial 2 have a timeout in the class. Can you add a timeout or point me in the direction of making one in my sketch using this class.

Receiving DMX buffer shift?

Hello,
I am using this library to send and receive DMX. When receiving the array seems to be shifted right every frame. I am not sure what is causing this.

Also thanks for making this! I am using this for work and would be happy to make a donation, please let me know how :)

Here is an example of the shifting, this pattern of 0s repeats, there should be no multiple zeros...

0, 0, 0, 0, 0, 0, 0, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,

0, 0, 0, 0, 0, 0, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,

0, 0, 0, 0, 0, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,

0, 0, 0, 0, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,

0, 0, 0, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,

0, 0, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,

0, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,

172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.