Arrays in flowcode for AVR ver 4

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
riveva
Flowcode V4 User
Posts: 6
Joined: Mon Feb 11, 2008 1:09 pm
Location: Finland

Arrays in flowcode for AVR ver 4

Post by riveva »

What's going wrong. I try to use 2-dimensional arrays in flowcode with C-blocks . I think that the syntax is right.

In C-block I wrote:
"
unsigned char FCV_LABY [7][10]={
{0x01,0x02,0x0B,0x09,0x03,0x0A,0x09,0x03,0x0B,0x08},
{0x06,0x09,0x05,0x06,0x0D,0x03,0x0C,0x05,0x06,0x09},
{0x01,0x05,0x06,0x09,0x04,0x06,0x09,0x06,0x09,0x05},
{0x05,0x06,0x09,0x06,0x09,0x01,0x09,0x06,0x09,0x05},
{0x05,0x06,0x09,0x06,0x09,0x01,0x06,0x09,0x05,0x05},
{0x07,0x0E,0x0B,0x0B,0x0C,0x05,0x03,0x0A,0x0C,0x05},
{0x04,0x02,0x0C,0x04,0x02,0x0E,0x0E,0x0A,0x08,0x0F}
};

"


and later I'll try to read this array in C-block
"
FCV_APU1=FCV_LABY[FCV_RIVI,FCV_SARAKE];

"
apu1, rivi and sarake are global variables..
but it doesn't work ....

What's wrong???

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times

Re: Arrays in flowcode for AVR ver 4

Post by Sean »

Hello,

The array initialization syntax is correct.

The command to read back an array element has the two index values in a single set of brackets separated by a comma. These values should be in separate square brackets:

FCV_APU1=FCV_LABY[FCV_RIVI][FCV_SARAKE];

riveva
Flowcode V4 User
Posts: 6
Joined: Mon Feb 11, 2008 1:09 pm
Location: Finland

Re: Arrays in flowcode for AVR ver 4

Post by riveva »

It seems to work, I have to correct my errors. Thank You very much...........

Post Reply