Arduino Mega 2560 Serial 64 channels Vixen 3

dcastator

New member
I amusing an Arduino Mega 2560 with serial communication with Vixen 3. It works with 63 channels, but not 64. Also tried 65 no luck.


Arduino code sends pixels to 8x8 matrix for now....


// Program to exercise the MD_MAX72XX library
//
// Uses most of the functions in the library
#include <MD_MAX72xx.h>


// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW
#define MAX_DEVICES 1

#define CLK_PIN 10 // or SCK
#define DATA_PIN 12 // or MOSI
#define CS_PIN 11 // or SS

MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

// We always wait a bit between updates of the display
#define DELAYTIME 100 // in milliseconds



#define CHANNEL_COUNT 63


int incomingByte[63]; // Define array to hold incoming data stream from Vixen

#define BAUD_RATE 9600 // Define baud rate. This must match profile configuration in Vixen!
int ROW = 0;
int COL = 0;

void setup()
{

Serial.begin(BAUD_RATE); // opens serial port, sets data rate to 9600 bps
mx.begin();

}

void loop()
{
mx.control(MD_MAX72XX::INTENSITY, 2);
if (Serial.available() >= CHANNEL_COUNT)
{
// Read data from Vixen, store in array
for (int i = 0; i < CHANNEL_COUNT; i++)
{
incomingByte = Serial.read();
}
// Write data from array to a pin on Arduino
for (int i = 0; i < CHANNEL_COUNT; i++)
{
ROW = i/8;
COL = i-ROW*8;

if (incomingByte != 0)
{
mx.setPoint(COL, ROW, true);
}
if (incomingByte == 0)
{
mx.setPoint(COL, ROW, false);
}
// digitalWrite(channels, incomingByte);
}
}

//mx.clear();


}
 
Back
Top