LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing serial data from Arduino Uno to a LED matrix board using Arduino compatible compiler.

Hi!

 

I am using an arduino uno (connected to PC usign USB) with an RS-485 converter connected to port 0 (RX) and 1 (TX). With the RS-485 converter is connected to a matrix led board (7x28 leds). 

The matrix is functioning perfectly using the deployed Arduino sketch below, which means the serial settings / connection works. 

Now I'm trying to deploy a LabVIEW VI to the uno with a similar functionality, using the arduino compatible compiler. I tried their forum but it's not even possible to register for an account, so that's why I try it here.

 

So I created a VI and attached the snippet of it, which apparently does not work. The function of the VI is to display a single screen with all the LEDs turned on. When I compile and deploy the code to the Uno with the compiler (no errors), I do see the 'TX' led on the uno blink for a moment. Yet the display remains empty. 

 

Does anybody have an idea how to make the deployed VI work? 

 

WORKING ARDUINO SKETCH:

 

// control pin
const int txden = 8;

// data starts with an empty array (black screen)
byte data[] = {
0x80, 0x83, 0x15, //prefix
0,0,0,0,0,0,0, // dot data
0,0,0,0,0,0,0, // dot data
0,0,0,0,0,0,0, // dot data
0,0,0,0,0,0,0, // dot data
0x8F // suffix
};

// studio designs
const byte studioDesigns[] = {B0000000, B0000000, B0000000, B0101100, B0101010, B0011010, B0000000, B0000010, B0111110, B0000010, B0000000, B0111110, B0100000, B0111110, B0000000, B0111110, B0100010, B0011100, B0000000, B0111110, B0000000, B0111110, B0100010, B0111110, B0000000, B0000000, B0000000, B0000000, B0000000, B0000000,
B0000000, B0111110, B0100010, B0011100, B0000000, B0111110, B0101010, B0101010, B0000000, B0101100, B0101010, B0011010, B0000000, B0111110, B0000000, B0111110, B0100010, B0111010, B0000000, B0111110, B0000010, B0111110, B0000000, B0101100, B0101010, B0011010, B0000000, B0000000,
B0000000, B0000000};

int pos;

void setup() {
Serial.begin(57600);
pinMode(txden, OUTPUT);
digitalWrite(txden, HIGH); // master
}

void loop() {
for (int k=3; k<30; k++) data[k] = data[k+1]; //scroll dot data one position to left
data[30] = studioDesigns[pos]; //insert next dots from message: positie 30 van 'data' wordt gevuld met studiodesigns[0]
Serial.write(data, 32); //update display
pos++; //move to next dots from message
if (pos >= sizeof(studioDesigns)) pos = 0;
delay(1000);
}

0 Kudos
Message 1 of 1
(501 Views)