LEDancer - Tec Fac...
 
Notifications
Clear all

LEDancer - Tec Factory ?

9 Posts
4 Users
0 Reactions
3,317 Views
Wolfie
Posts: 2225
Topic starter
(@wolfie)
Noble Member
Joined: 11 years ago

Yea, I emailed them. They are USB only and it appears they are only seqencable using their software. Which puts them out of the running.

However, the idea and the look I think would be something new. I haven't seen any new looking element show up in a while and I thought this could be something that might get started as another design element. Got all summer to experiment 🙂


Reply
Posts: 4092
(@skunberg)
Famed Member
Joined: 18 years ago

The cover has drilled holes on the side which would direct the light. I think a regular 8mm led would work fine.


Reply
Barnabybear
Posts: 1583
(@barnabybear)
Noble Member
Joined: 15 years ago

Hi, if you realy want one. Below is a schimatic and code for an E1.31 (ESP8266) version that will control 16 LEDS. If you want more just add another PCA9685, the code will handle 4 ICs so 64 channels. You can sequence it, like anything else we use with Vixen, HLS or xlights.

The LEDs can be fed with anything up to 5.5V and up to 25mA max but the ESP8266 and the PCA9685 need 3.3V. I've tried with white LEDs powered with 3.3V and didn't need the resistors (they only drew 20mA). But check anything you use yourself.

To use:
The only changes you should need in the code is to add your SSID, Password and Universe number on lines 7, 8 & 9.

const char ssid[] = "xxxxxxxxxx";         /* Replace with your SSID */
const char passphrase[] = "xxxxxxxxxxxx";   /* Replace with your WPA2 passphrase */
const int universe = 1;   /* Replace with your universe number */

Wire.h needs one value changing

 #define BUFFER_LENGTH 32 // needs changing to
#define BUFFER_LENGTH 68 // if not only the first 7 leds will work 

and its laggy with debug on, so once it works ok swap the 1 to 0 on line 22.

const int debug = 1; //set value 1= debug 0 = normal 

Compile with processor speed at 160Mhz for best results. It's set to use channels 1 to 16 but you can change that if required.


#include <ESP8266WiFi.h>
#include <E131.h>
#include <Wire.h>

//==================== Setup infomation section start ====================//
                        //==== WiFi & Universe ====//
const char ssid[] = "xxxxxxxxxx";         /* Replace with your SSID */
const char passphrase[] = "xxxxxxxxxxxx";   /* Replace with your WPA2 passphrase */
const int universe = 1;   /* Replace with your universe number */
const int channel = 0;   /* Replace with your channel number */

                        //==== Control boards ====//
//set boards used, 1 = used, 0 = not, order = Board 0x43, Board 0x42, Board 0x41, Board 0x40.
const int board_used = (B0001); // boards used.
//channel numbers for output 1 -> 16 in that order, 0 = unused output.
int board_40[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; // if fitted.
int board_41[16] = {0, 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}; // if fitted.
int board_42[16] = {0, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45}; // if fitted.
int board_43[16] = {0, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60}; // if fitted.
//if using RGB strip use outputs 2 to 16 to match PTC fuses.
                        //==== Debug - may cause lag ====//
const int debug = 1; //set value 1= debug 0 = normal
//==================== Setup infomation section end ====================//

int gamma_val[256] = {0, 1, 1, 1, 1, 2, 2, 3, 4, 5, 6, 8, 9, 11, 12, 14, 16, 18, 20,
23, 25, 28, 30, 33, 36, 39, 43, 46, 49, 53, 57, 61, 64, 69, 73, 77, 82, 86, 91, 96,
101, 106, 111, 116, 122, 128, 133, 139, 145, 151, 157, 164, 170, 177, 184, 191, 197,
205, 212, 219, 227, 234, 242, 250, 258, 266, 274, 283, 291, 300, 309, 317, 326, 336,
345, 354, 364, 373, 383, 393, 403, 413, 423, 434, 444, 455, 466, 477, 488, 499, 510,
522, 533, 545, 556, 568, 580, 593, 605, 617, 630, 642, 655, 668, 681, 694, 708, 721,
735, 748, 762, 776, 790, 804, 818, 833, 847, 862, 877, 892, 907, 922, 937, 953, 968,
984, 1000, 1016, 1032, 1048, 1064, 1081, 1097, 1114, 1131, 1148, 1165, 1182, 1199, 1217,
1234, 1252, 1270, 1288, 1306, 1324, 1342, 1361, 1379, 1398, 1417, 1436, 1455, 1474, 1494,
1513, 1533, 1552, 1572, 1592, 1612, 1632, 1653, 1673, 1694, 1715, 1735, 1756, 1777, 1799,
1820, 1841, 1863, 1885, 1907, 1929, 1951, 1973, 1995, 2018, 2040, 2063, 2086, 2109, 2132,
2155, 2179, 2202, 2226, 2250, 2273, 2297, 2322, 2346, 2370, 2395, 2419, 2444, 2469, 2494,
2519, 2544, 2570, 2595, 2621, 2647, 2672, 2698, 2725, 2751, 2777, 2804, 2830, 2857, 2884,
2911, 2938, 2965, 2993, 3020, 3048, 3076, 3104, 3132, 3160, 3188, 3217, 3245, 3274, 3303,
3331, 3360, 3390, 3419, 3448, 3478, 3507, 3537, 3567, 3597, 3627, 3658, 3688, 3719, 3749,
3780, 3811, 3842, 3873, 3905, 3936, 3968, 3999, 4031, 4063, 4095}; //gamma corrected channel value.
int OUTPUT_NUMBER;
int CHANNEL_NUMBER;
int CHANNEL_VALUE;
int OUTPUT_VALUE;
int OE = 3; //OE = GPIO 3.
E131 e131;

void setup() {
Wire.begin(0,2); //start Wire and set SDA - SCL
Serial.begin(115200); //start serial for debug.

                    //========== PCA setup ==========//

    if(bitRead(board_used,0)){ //check to see if this board is used - if not skip section.
      Wire.beginTransmission(0x40); //start comms with board 0x40.
      Wire.write(00); //move pointer to MODE 1 register.
      Wire.write(0xa1); //enables ALL CALL ADDRESS, Register Auto-Increment & Restart.
      Wire.endTransmission(); //end comms with board.
    }                                                                                        if(debug) {Serial.println("board 0x40 first setup done");}
    if(bitRead(board_used,1)){ //check to see if this board is used - if not skip section.
      Wire.beginTransmission(0x41); //start comms with board 0x41.
      Wire.write(00); //move pointer to MODE 1 register.
      Wire.write(0xa1); //enables ALL CALL ADDRESS, Register Auto-Increment & Restart.
      Wire.endTransmission(); //end comms with board.
    }                                                                                        if(debug) {Serial.println("board 0x41 first setup done");}  
    if(bitRead(board_used,2)){ //check to see if this board is used - if not skip section.
      Wire.beginTransmission(0x42); //start comms with board 0x42.
      Wire.write(00); //move pointer to MODE 1 register.
      Wire.write(0xa1); //enables ALL CALL ADDRESS, Register Auto-Increment & Restart.
      Wire.endTransmission(); //end comms with board.
    }                                                                                        if(debug) {Serial.println("board 0x42 first setup done");} 
    if(bitRead(board_used,3)){ //check to see if this board is used - if not skip section.
      Wire.beginTransmission(0x43); //start comms with board 0x43.
      Wire.write(00); //move pointer to MODE 1 register.
      Wire.write(0xa1); //enables ALL CALL ADDRESS, Register Auto-Increment & Restart.
      Wire.endTransmission(); //end comms with board.
    }                                                                                        if(debug) {Serial.println("board 0x43 first setup done");}
  
  Wire.beginTransmission(0xE0); //start comms with all boards (ALLCALLADR).
  Wire.write(01); //move pointer to MODE 2 register.
  Wire.write(0x0F); //invert outputs for use with FETs - (0x02) to set as source.
  Wire.endTransmission(); //end comms with board.
                                                                                             if(debug) {Serial.println(); Serial.println("all boards second setup done");}
  Wire.beginTransmission(0xE0); //start comms with all boards (ALLCALLADR).
  Wire.write(0x06); //move pointer to LED 0 register.
  for (OUTPUT_NUMBER = 0; OUTPUT_NUMBER < 64; OUTPUT_NUMBER++) { //loop 64 times.
  Wire.write(0x00); //write on time 0, off time 0 to all LEDs (all off).
  }                                                                                           if(debug) {Serial.println("all boards third setup done");}
Wire.endTransmission();  //end comms with board.

                        //========== ESP8266-01 setup ==========//
  pinMode(OE, FUNCTION_3); //change pin 3 from Rx to GPIO 3 (OE output enable).
  digitalWrite(OE, LOW); //set OE low to enable outputs.
                                                                                              if(debug) {Serial.println("all boards setup complete ");}
                        //========== e131 setup ==========//
  /* Choose one to begin listening for E1.31 data */
  e131.begin(ssid, passphrase);               /* via Unicast on the default port */
  //e131.beginMulticast(ssid, passphrase, universe); /* via Multicast for Universe 1 */
                                                                                              if(debug) {Serial.println("if paused - waiting for e1.31 data ");}
}

void loop() {
    /* Parse a packet */
    uint16_t num_channels = e131.parsePacket();
    
    /* Process channel data if we have it */
    if (num_channels) {

                        //========== board 0x40 main loop ==========//
    if(bitRead(board_used,0)){ //check to see if this board is used - if not skip section.
      Wire.beginTransmission(0x40); //start comms with board 0x40.
                                                                                            if(debug) {Serial.print("board "); Serial.println(0x40);}
      Wire.write(0x06); //move pointer to LED 0 register.
      for (OUTPUT_NUMBER = 0; OUTPUT_NUMBER < 16; OUTPUT_NUMBER++) { //cycle through outputs.         
                                                                                            if(debug) {Serial.print(" | OUTPUT_NUMBER "); Serial.print(OUTPUT_NUMBER);}    
        CHANNEL_NUMBER = board_40[OUTPUT_NUMBER]; //lookup channel number for output.                           
                                                                                            if(debug) { Serial.print(" | CHANNEL_NUMBER "); Serial.print(CHANNEL_NUMBER);}
        WRITE_FUNCTION(); //call function to finish lookups and write data.
      }
      Wire.endTransmission();
    } //0x40 end
                        //========== board 0x41 main loop ==========//
    if(bitRead(board_used,1)){ //check to see if this board is used - if not skip section.
      Wire.beginTransmission(0x41); //start comms with board 0x41.
                                                                                            if(debug) {Serial.print("board "); Serial.println(0x41);}
      Wire.write(0x06); //move pointer to LED 0 register.
      for (OUTPUT_NUMBER = 0; OUTPUT_NUMBER < 16; OUTPUT_NUMBER++) { //cycle through outputs.
                                                                                            if(debug) {Serial.print(" | OUTPUT_NUMBER "); Serial.print(OUTPUT_NUMBER);}     
        CHANNEL_NUMBER = board_41[OUTPUT_NUMBER]; //lookup channel number for output.
                                                                                            if(debug) { Serial.print(" | CHANNEL_NUMBER "); Serial.print(CHANNEL_NUMBER);}      
        WRITE_FUNCTION(); //call function to finish lookups and write data.
      }
      Wire.endTransmission();
    } //0x41 end
                        //========== board 0x42 main loop ==========//
    if(bitRead(board_used,2)){ //check to see if this board is used - if not skip section.
      Wire.beginTransmission(0x42); //start comms with board 0x42.
                                                                                            if(debug) {Serial.print("board "); Serial.println(0x42);}
      Wire.write(0x06); //move pointer to LED 0 register.
      for (OUTPUT_NUMBER = 0; OUTPUT_NUMBER < 16; OUTPUT_NUMBER++) { //cycle through outputs.
                                                                                            if(debug) {Serial.print(" | OUTPUT_NUMBER "); Serial.print(OUTPUT_NUMBER);}         
        CHANNEL_NUMBER = board_42[OUTPUT_NUMBER]; //lookup channel number for output.
                                                                                            if(debug) { Serial.print(" | CHANNEL_NUMBER "); Serial.print(CHANNEL_NUMBER);}         
        WRITE_FUNCTION(); //call function to finish lookups and write data.
      }
      Wire.endTransmission();
    } //0x42 end
                        //========== board 0x43 main loop ==========//
    if(bitRead(board_used,3)){ //check to see if this board is used - if not skip section.
      Wire.beginTransmission(0x43); //start comms with board 0x43.
                                                                                            if(debug) {Serial.print("board "); Serial.println(0x43);}
      Wire.write(0x06); //move pointer to LED 0 register.
      for (OUTPUT_NUMBER = 0; OUTPUT_NUMBER < 16; OUTPUT_NUMBER++) { //cycle through outputs.
                                                                                            if(debug) {Serial.print(" | OUTPUT_NUMBER "); Serial.print(OUTPUT_NUMBER);}        
        CHANNEL_NUMBER = board_43[OUTPUT_NUMBER]; //lookup channel number for output.
                                                                                            if(debug) { Serial.print(" | CHANNEL_NUMBER "); Serial.print(CHANNEL_NUMBER);}       
        WRITE_FUNCTION(); //call function to finish lookups and write data.
      }
      Wire.endTransmission();
    } //0x43 end

                                                                                            if(debug) { Serial.println("End of loop");}
  }} //if & void loop end

                        //========== write output function ==========//
void WRITE_FUNCTION() { //function to finish lookups and write data to PCA9685. Registers set to auto increment.
  switch (CHANNEL_NUMBER) {
    case 0: //check if channel unused (0).
      OUTPUT_VALUE = 0; //set value to 0.
                                                                                            if(debug) { Serial.print(" | UN-USED_OUTPUT ");} 
      break;
    default: //if here channel must bee used so get value.
      CHANNEL_VALUE = e131.data[CHANNEL_NUMBER - 1]; //lookup value of channel.
                                                                                            if(debug) { Serial.print(" | CHANNEL_VALUE "); Serial.print(CHANNEL_VALUE);}
      OUTPUT_VALUE = gamma_val[CHANNEL_VALUE]; //lookup gamma corrected value.
  }
  Wire.write (0x00); //switch on time LSB - switches on at zero.
                                                                                            if(debug) { Serial.print(" | LSB ON "); Serial.print(0x00);}
  Wire.write (0x00); //switch on time MSB.
                                                                                            if(debug) { Serial.print(" | MSB ON "); Serial.print(0x00);}
  Wire.write (OUTPUT_VALUE); //switch off time LSB - switches off after OUTPUT_VALUE cycles.
                                                                                            if(debug) { Serial.print(" | LSB OFF "); Serial.print((OUTPUT_VALUE));}
  OUTPUT_VALUE = OUTPUT_VALUE >> 8; //bit shift to remove LSB.
  Wire.write (OUTPUT_VALUE); //switch off time MSB.
                                                                                            if(debug) { Serial.print(" | MSB OFF "); Serial.println(OUTPUT_VALUE);}
} //write output end

Edit: I've just spotted the 3.3V and Ground are swapped on the PCA9685 - I'll amend the drawing.


Reply
Wolfie
Posts: 2225
Topic starter
(@wolfie)
Noble Member
Joined: 11 years ago

I was actually thinking of 3D printing the shell and then laying in WS2811 boards and the water clear 15deg RGB LEDs. I don't think I will go with an extra one in the middle for the logo light as they did. Kinda pointless at any reasonable distance if you ask me. Instead of a logo, perhaps some sort of translucent dome with a center pixel. Have to think on it.

Once the weather gets nicer, I will grab a couple 2811 boards and the LEDs off ebay. Then see how it looks on the wall and at distance before I go all in an order a bunch of parts and design the housing. Would all be a waste if it looks like crap on the wall eh?

My other thoughts on these was to use them horizontal mounted on pegs in the ground to color wash the ground (snow). Again have to tinker with a prototype and see if I like it.


Reply
Page 2 / 2
Share: