//############################################################################## //############################################################################## // # // Glediator to WS2812 pixel converter # // by R. Heller # // V 1.0 - 07.01.2014 # // wwww.SolderLab.de # // # // Receives serial data in Glediator protocol format @ 1 MBit/s # // and distributes it to a connectect chain of WS2812 pixels # // # // Adjust the correct DATA PIN and the correct NUMBER OF PIXELS you are using # // in the definitions section below before uploading this sketch to your # // Arduino device. # // # // Maxiumim number of supported pixeles is 512 !!! # // # // In the Glediator software set output mode to "Glediator_Protocol", # // color order to "GRB" and baud rate to "1000000" # // # //############################################################################## //############################################################################## //############################################################################## // # // Definitions --> Make changes ONLY HERE # // # // To find out the correct port, ddr and pin name when you just know the # // Arduino's digital pin number just google for "Arduino pin mapping". # // In the present example digital Pin 6 is used which corresponds to "PORTD", # // "DDRD" and "6", respectively. # // # //############################################################################## #define DATA_PORT PORTD #define DATA_DDR DDRD #define DATA_PIN 6 #define NUMBER_OF_PIXELS 40 //############################################################################## // # // Variables # // # //############################################################################## unsigned char display_buffer[NUMBER_OF_PIXELS * 3]; static unsigned char *ptr; static unsigned int pos = 0; volatile unsigned char go = 0; //############################################################################## // # // Setup # // # //############################################################################## void setup() { // Set data pin as output DATA_DDR |= (1 << DATA_PIN); // Initialize UART UCSR0A |= (1<