How to drive LED array on XK-AUDIO-216-MC-AB?
Posted: Sun Apr 08, 2018 8:19 am
Dear Everyone,
I'm working on the xCORE-200 Multichannel Audio Platform, which has a 4*4 LED-array on it. The LED array is driven by eight signals each controlling one of 4 rows and 4 columns. Rows are controlled by a 4-bit port XS1_PORT_4C, and columns are controlled by a 4-bit port XS1_PORT_4D.According to the XMOS progamming guide, I declared 2 out ports as global variables like this:
And I called them like this in the i2s_loopback function of example AN00162:
However, nothing happened to the leds, they weren't actived. What's wrong in it?
Thank you very much!
cjf
I'm working on the xCORE-200 Multichannel Audio Platform, which has a 4*4 LED-array on it. The LED array is driven by eight signals each controlling one of 4 rows and 4 columns. Rows are controlled by a 4-bit port XS1_PORT_4C, and columns are controlled by a 4-bit port XS1_PORT_4D.According to the XMOS progamming guide, I declared 2 out ports as global variables like this:
Code: Select all
on tile[0]: out port led_row = XS1_PORT_4C;
on tile[0]: out port led_col = XS1_PORT_4D;
Code: Select all
case i2s.receive(size_t index, int32_t sample):
samples[index] = sample;
if(sample == 0){
led_row <: 0x0E;
led_col <: 0x0E;
} // want to active the led of row0 ,col0
// xscope_int(0, sample);
break;
case i2s.send(size_t index) -> int32_t sample:
sample = samples[index];
// xscope_int(1, sample);
if(sample != 0){
led_row <: 0x07;
led_col <: 0x07; // want to active the led of row3 ,col3
}
break;
Thank you very much!
cjf