Arduino Leonardo, windows 7 64bit
For a start.... i,m new i,m working on my first real project with arduino, and maybe i should just try an get a led blinking ![]()
However i work on a dmx controller wich has to make a drag race light tree to work when a button is pushed, i made the following programming after reading a lot. When i try to upload it it gives a message that i cant (see screenshot)
It basicly says it cant find the library, but it is on my comp in library directory of arduino.
Help please
/*************************************************************************************************************
*
* Title : Example DMX Muxer with channel patch for Arduino 4 universes DMX library.
* Version : v 0.3
* Last updated : 07.07.2012
* Target : Arduino mega 2560, Arduino mega 1280
* Author : Toni Merino - merino.toni at gmail.com
* Web : www.deskontrol.net/blog
*
**************************************************************************************************************/
#include <lib_dmx.h> // comment/uncomment #define USE_UARTx in lib_dmx.h as needed
// This sample get the first 200 channels from universe 1 + the first 200 channels from universe 2, and write all
// to universe 3 (addresses 1-200 from universe 2 are converted to 201-400)
//*********************************************************************************************************
// New DMX modes *** EXPERIMENTAL ***
//*********************************************************************************************************
#define DMX512 (0) // (250 kbaud - 2 to 512 channels) Standard USITT DMX-512
#define DMX1024 (1) // (500 kbaud - 2 to 1024 channels) Completely non standard - TESTED ok
#define DMX2048 (2) // (1000 kbaud - 2 to 2048 channels) called by manufacturers DMX1000K, DMX 4x or DMX 1M ???
void setup()
{
// configurar pines arduino del 2 al 13 como entradas con pullup, (cuando se pulsa el boton = 0 si no = 1)
// configure arduino pins 2 to 13 as inputs with pullup, (button pressed = 0, button free = 1)
for (int i=2;i<=13;i++)
{
pinMode(i,INPUT);
digitalWrite(i, HIGH);
ArduinoDmx1.set_control_pin(24); // Arduino output pin for MAX485 input/output control (connect to MAX485-1 pins 2-3)
ArduinoDmx2.set_control_pin(26); // Arduino output pin for MAX485 input/output control (connect to MAX485-2 pins 2-3)
ArduinoDmx3.set_control_pin(28); // Arduino output pin for MAX485 input/output control (connect to MAX485-3 pins 2-3)
ArduinoDmx1.set_rx_address(1); // set rx1 start address
ArduinoDmx2.set_rx_address(1); // set rx2 start address
ArduinoDmx3.set_tx_address(1); // set tx start address
ArduinoDmx1.set_rx_channels(200); // 2 to 2048!! channels in DMX1000K (512 in standard mode) See lib_dmx.h *** new *** EXPERIMENTAL
ArduinoDmx2.set_rx_channels(200); // 2 to 2048!! channels in DMX1000K (512 in standard mode) See lib_dmx.h *** new *** EXPERIMENTAL
ArduinoDmx3.set_tx_channels(400); // 2 to 2048!! channels in DMX1000K (512 in standard mode) See lib_dmx.h *** new *** EXPERIMENTAL
// New parameter needed: DMX Mode
ArduinoDmx1.init_rx(DMX512); // starts universe 1 as rx, standard DMX 512 - See lib_dmx.h, now support for DMX faster modes (DMX 1000K)
ArduinoDmx2.init_rx(DMX512); // starts universe 2 as rx, standard DMX 512 - See lib_dmx.h, now support for DMX faster modes (DMX 1000K)
ArduinoDmx3.init_tx(DMX512); // starts universe 3 as tx, standard DMX 512 - See lib_dmx.h, now support for DMX faster modes (DMX 1000K)
}//end setup()
void loop()
{
// copy 200 channels from rx buffer 1 to tx buffer 3
memcpy((void *)ArduinoDmx3.TxBuffer, (void *)ArduinoDmx1.RxBuffer, 200);
// copy 200 channels from rx buffer 2 to tx buffer 3, position 200 (patch from 1-200 to 201-400)
memcpy((void *)&ArduinoDmx3.TxBuffer[200], (void *)ArduinoDmx2.RxBuffer, 200);
ArduinoDmx0.TxBuffer[0] = scale(analogRead(0)); // copiar valor de la entrada analogica 0 al canal DMX 1
// copy value from analog input 0 to DMX channel 1
ArduinoDmx0.TxBuffer[1] = scale(analogRead(1)); // copiar valor de la entrada analogica 1 al canal DMX 2
// copy value from analog input 1 to DMX channel 2
ArduinoDmx0.TxBuffer[2] = scale(analogRead(2)); // copiar valor de la entrada analogica 2 al canal DMX 3
// copy value from analog input 2 to DMX channel 3
ArduinoDmx0.TxBuffer[3] = scale(analogRead(3)); // copiar valor de la entrada analogica 3 al canal DMX 4
// copy value from analog input 3 to DMX channel 4
ArduinoDmx0.TxBuffer[4] = scale(analogRead(4)); // copiar valor de la entrada analogica 4 al canal DMX 5
// copy value from analog input 4 to DMX channel 5
ArduinoDmx0.TxBuffer[5] = scale(analogRead(5)); // copiar valor de la entrada analogica 5 al canal DMX 6
// copy value from analog input 5 to DMX channel 6
if (digitalRead(2) == LOW) // pulsador en pin 2 apretado // push-button on pin 2, is pressed
ArduinoDmx0.TxBuffer[0] = 255;
delay (500);
ArduinoDmx0.Txbuffer[0] = 0;
delay (500);
ArduinoDmx0.txbuffer[1] = 255;
delay (500);
ArduinoDmx0.txbuffer[1] = 0;
delay (500);
ArduinoDmx0.txbuffer[2] = 255;
delay (2000);
ArduinoDmx0.txbuffer[2] = 0;
delay (500);
ArduinoDmx0.txbuffer[2] = 255;
delay (2000);
ArduinoDmx0.txbuffer[2] = 0;
}//end loop()
[/td]
[/tr]
[/table]
