Hi everybody, I've built the DMX circuit that is described in the tutorial on http://www.arduino.cc/playground/Learning/DMX, using the SN75176B chip and using an old arduino with atmega168. Now I'm trying to put the code from the tutorial on the arduino, but there are a lot of things going wrong. Probably because the code was written for 0004 or 0005, and I'm using arduino 0010.
couple of things in the code I don't understand and which give compiler errors:
port_to_output[digital_pin_to_port[pin].port];Is this some sort of array, or object? Compiler error says it's not declared, which is true, it's not getting declared anywhere.
_SFR_BYTE(_SFR_IO8(portNumber)) |= _BV(pinNumber); (...) _SFR_BYTE(_SFR_IO8(portNumber)) &= ~_BV(pinNumber); (...) _SFR_BYTE(_SFR_IO8(portNumber)) |= _BV(pinNumber); (...) _SFR_BYTE(_SFR_IO8(portNumber)) &= ~_BV(pinNumber);
???. I've made projects with arduino for almost 2 years now, but never ran into these kind of codes. Help, what are they doing here? Where did the come from? Is it machinecode or something else that directly talks to the atmega chip? Is it because I should just not try to mess with the incredible Zen powers of DMX? I'm getting a little scared here.