I don't have a Due but I successfully compiled your code for a Due using Arduino 1.8.9.
Arduino DUE with Vixen and Pixels
This problem comes second to my main problem of trying to get a MEGA to run 200 Pix. I thought this might be that solution.
An Arduino DUE, 32-bit ARM core micro controller at 84 MHz and 96 KB of SRAM (two banks: 64 KB and 32 KB). Thinking this upgrade would remove the bottle necks of the MEGA I bought one to try.
When trying to compile the current somewhat working code it gives me an error on a return;
Code:Arduino: 1.8.10 (Windows 7), Board: "Arduino Due (Programming Port)" D:\XMASFiles 2018\VixPix_Sketch_2019_DUEMod\VixPix_Sketch_2019_DUEMod.ino: In function 'int bugit(String, int)': VixPix_Sketch_2019_DUEMod:133:2: error: return-statement with no value, in function returning 'int' [-fpermissive] return; ^ D:\XMASFiles 2018\VixPix_Sketch_2019_DUEMod\VixPix_Sketch_2019_DUEMod.ino: In function 'void waitForVixenHeader()': D:\XMASFiles 2018\VixPix_Sketch_2019_DUEMod\VixPix_Sketch_2019_DUEMod.ino:146:18: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] char *header="VIXStart"; ^ Multiple libraries were found for "Adafruit_NeoPixel.h" Used: C:\Users\FXUSER\Documents\Arduino\libraries\Adafruit_NeoPixel Not used: C:\Users\FXUSER\Documents\Arduino\libraries\Adafruit_NeoPixel-master exit status 1 return-statement with no value, in function returning 'int' [-fpermissive] This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
If I remove the return; it will compile, but nothing works when ran.
Has anyone else had success with a DUE?
Working Code on the MEGA and code that isn't compiling for the DUE:
Code:/*===================================== = VixPix Sketch = For basic control of RGB Pixels using Vixen Generic Serial3 Protocol =====================================*/ /** * VIXEN Setup: * In Vixen display setup... * - Add an element group containing one element for each pixel attached to arduino * - Configure the 'Color Handling' as "They can be any color: Full RGB" * - Add a "Generic Serial3 Controller" * - Name it what you want (Although... Jdc928IsAwesome is great controller name) * - Set the channel count to 3x the number of Pixels you have * - Save, then configure these options * - Com Port: choose the correct port for your arduino's Serial3 * - Baud Rate: 115200 (or whatever you changed it to below) * - Click OK * - Check the box "Send a text header" * - Type "VIXStart" in the header text box * - Click "OK" * * - Click and highlight the newly added Element in the elements list * - Click and highlight the newly created controller * - Your "Total Patch Points" and "Output" counts should match * - Click "Patch Elements to Controllers" * - Click OK and you should be ready to go * * * You should now be able open a Sequence add some effects to the new channels and see the strips responding accordingly */ /** * Pixel Strip Setup * Strips setups vary but generally as follows * - If your using a large number of strips you will * probably want to power them externally. * * - Connect external V+ to strip Vin * - Connect external Gnd to strip Gnd * - Connect external Gnd to Arduino Gnd * - Connect Strip Data to proper pin on Arduino * - Connect Strip DataClock to proper pin on Arduino if not using ws2812 */ #include <Adafruit_NeoPixel.h> // This is the Neo-Pixel library (ws2812) // Change to the library for your pixel types // Suggest using a library created by Adafruit // so the function names will be the same #define DPIN 6 // Change this to the pin# connected to your pixels DataIn // Will probably need to define a ClockPin for other pixel int PixelCount = 99; // Set this to the number of Pixels connected int bugLevel = 0; // This is just a way I manage turning debugging over Serial3 on/off /* Sets up the NeoPixel Strip object Replace with proper Object initiation for your pixel types */ Adafruit_NeoPixel strip = Adafruit_NeoPixel(PixelCount, DPIN, NEO_RGB + NEO_KHZ800); void setup() { delay(100); // A delay for a reason I can't remember. I can live with one in the setup. strip.begin(); // Get strip started strip.show(); // Initialize all pixels to 'off' Serial3.begin(115200); // Start the Serial3 communication 57600 bugit("Setup Complete",10); // DEBUG: Confirm setup is complete } void loop() { // START LOOP if (Serial3.available()>2) // Wait for a few bytes to be recieved { bugit("Waiting for Header",10); // DEBUG: Header waiting started waitForVixenHeader(); // Header check function bugit("VixStart Triggered",10); // DEBUG: Header found; getting color data for (int pixCount=0; pixCount<PixelCount;pixCount++) // Do this for as many Pixels defined in PixelCount { int RGB[3]; // Create array to hold this pixels RGB value for (int color = 0;color<3;color++) // For the next 3 incoming bytes { while (Serial3.available() < 1) // Wait for bytes to be received { delay(10); } RGB[color] = Serial3.read(); // Save this byte to the correct RGB value } // Repeat until bytes for this pixels RGB value have been recieved strip.setPixelColor(pixCount,RGB[0],RGB[1],RGB[2]); //Set this pixels new color } // Repeat untill all pixels have had new RGB value set strip.show(); // Update the strip and show with new color } // YAY! DO IT AGAIN! } // END OF LOOP /** * FUNC bugit [manages printing of debugging based on debugging level] * @param String bugstr [string to be be printed] * @param int blevel [the level at which this debugging should be ignored] * */ int bugit(String bugstr,int blevel) { if (blevel < bugLevel) { Serial3.println(bugstr); } } /** * I 'borrowed' snippets of this waitForVixenHeader() function from some code I found online * Can't find the originator now but thank you. It works well. * */ void waitForVixenHeader() { bugit("Waiting Loop",10); char *header="VIXStart"; char buffer[3]; int index = 0; while (true) { int inByte = Serial3.read(); if(inByte==-1) { continue; } buffer[index] = inByte; if(buffer[index]!=header[index]) { index=-1; // not the right sequence restart } buffer[index+1] = 0; // add null index++; if(index==8) { return; } } }
Mostly C9 Light Show, powered by Arduino. 48A Full On last year. "It feels like a carnival"
https://www.facebook.com/ItsaDillonChristmas/
I don't have a Due but I successfully compiled your code for a Due using Arduino 1.8.9.
I copy and pasted the wrong code, I had removed the error line to see if it worked. It would compile but it didn't work. Below is what works with the MEGA but errors on the DUE. Still messing with the setup.
Code:/*===================================== = VixPix Sketch = For basic control of RGB Pixels using Vixen Generic Serial3 Protocol =====================================*/ /** * VIXEN Setup: * In Vixen display setup... * - Add an element group containing one element for each pixel attached to arduino * - Configure the 'Color Handling' as "They can be any color: Full RGB" * - Add a "Generic Serial3 Controller" * - Name it what you want (Although... Jdc928IsAwesome is great controller name) * - Set the channel count to 3x the number of Pixels you have * - Save, then configure these options * - Com Port: choose the correct port for your arduino's Serial3 * - Baud Rate: 115200 (or whatever you changed it to below) * - Click OK * - Check the box "Send a text header" * - Type "VIXStart" in the header text box * - Click "OK" * * - Click and highlight the newly added Element in the elements list * - Click and highlight the newly created controller * - Your "Total Patch Points" and "Output" counts should match * - Click "Patch Elements to Controllers" * - Click OK and you should be ready to go * * * You should now be able open a Sequence add some effects to the new channels and see the strips responding accordingly */ /** * Pixel Strip Setup * Strips setups vary but generally as follows * - If your using a large number of strips you will * probably want to power them externally. * * - Connect external V+ to strip Vin * - Connect external Gnd to strip Gnd * - Connect external Gnd to Arduino Gnd * - Connect Strip Data to proper pin on Arduino * - Connect Strip DataClock to proper pin on Arduino if not using ws2812 */ #include <Adafruit_NeoPixel.h> // This is the Neo-Pixel library (ws2812) // Change to the library for your pixel types // Suggest using a library created by Adafruit // so the function names will be the same #define DPIN 6 // Change this to the pin# connected to your pixels DataIn // Will probably need to define a ClockPin for other pixel int PixelCount = 99; // Set this to the number of Pixels connected int bugLevel = 0; // This is just a way I manage turning debugging over Serial3 on/off /* Sets up the NeoPixel Strip object Replace with proper Object initiation for your pixel types */ Adafruit_NeoPixel strip = Adafruit_NeoPixel(PixelCount, DPIN, NEO_RGB + NEO_KHZ800); void setup() { delay(100); // A delay for a reason I can't remember. I can live with one in the setup. strip.begin(); // Get strip started strip.show(); // Initialize all pixels to 'off' Serial3.begin(115200); // Start the Serial3 communication 57600 bugit("Setup Complete",10); // DEBUG: Confirm setup is complete } void loop() { // START LOOP if (Serial3.available()>2) // Wait for a few bytes to be recieved { bugit("Waiting for Header",10); // DEBUG: Header waiting started waitForVixenHeader(); // Header check function bugit("VixStart Triggered",10); // DEBUG: Header found; getting color data for (int pixCount=0; pixCount<PixelCount;pixCount++) // Do this for as many Pixels defined in PixelCount { int RGB[3]; // Create array to hold this pixels RGB value for (int color = 0;color<3;color++) // For the next 3 incoming bytes { while (Serial3.available() < 1) // Wait for bytes to be received { delay(10); } RGB[color] = Serial3.read(); // Save this byte to the correct RGB value } // Repeat until bytes for this pixels RGB value have been recieved strip.setPixelColor(pixCount,RGB[0],RGB[1],RGB[2]); //Set this pixels new color } // Repeat untill all pixels have had new RGB value set strip.show(); // Update the strip and show with new color } // YAY! DO IT AGAIN! } // END OF LOOP /** * FUNC bugit [manages printing of debugging based on debugging level] * @param String bugstr [string to be be printed] * @param int blevel [the level at which this debugging should be ignored] * */ int bugit(String bugstr,int blevel) { if (blevel < bugLevel) { Serial3.println(bugstr); } return; } /** * I 'borrowed' snippets of this waitForVixenHeader() function from some code I found online * Can't find the originator now but thank you. It works well. * */ void waitForVixenHeader() { bugit("Waiting Loop",10); char *header="VIXStart"; char buffer[3]; int index = 0; while (true) { int inByte = Serial3.read(); if(inByte==-1) { continue; } buffer[index] = inByte; if(buffer[index]!=header[index]) { index=-1; // not the right sequence restart } buffer[index+1] = 0; // add null index++; if(index==8) { return; } } }
Mostly C9 Light Show, powered by Arduino. 48A Full On last year. "It feels like a carnival"
https://www.facebook.com/ItsaDillonChristmas/
This code has a few flaws in the wait "waitForVixenHeader" function. char buffer[3] is too small. this should be coded as:
char header="VIXStart"; // this should not be a pointer
char buffer[sizeof(header)+1]; // This was too small
if(index == sizeof(header)) // never use a magic number. It will be wrong when you change the header.
2019 - Just moved into a new home (yet another change of plans). Will be dim but not dark. Too much to do at the new place to leave time for a show.
https://www.youtube.com/channel/UCyX...ttrsZNARkUce0Q
Thanks Martin. Well today I had a F it moment and bought an F16v3. I was asking my self why am I fighting with this stuff. HA
I do like to work with this stuff though, I think I will continue trying to get the DUE working and test its limitations. But at least my show will not be dependant on to much DIY stuff.
I'll post back my findings after I test it out more.
Sent from my LM-V405 using Tapatalk
Mostly C9 Light Show, powered by Arduino. 48A Full On last year. "It feels like a carnival"
https://www.facebook.com/ItsaDillonChristmas/
Bookmarks