SPI with Arduino to control LEDs

1 view (last 30 days)
XecutionStyle
XecutionStyle on 11 Oct 2017
Hello, I'm trying to control these APA102C LED's via SPI through an Arduino Due. You will see the SPI protocol if you scroll down.
a = arduino('COM6', 'DUE', 'Libraries', 'SPI');
LED = spidev(a, 'D11');
and
writeRead(LED, [0 0 0 0 255 0 0 255 0], 'uint8')
yields no results. I'm following this example. Is there anything wrong that you see? I'm on Matlab 2017a.
Thank you
  2 Comments
XecutionStyle
XecutionStyle on 14 Oct 2017
I managed to get the SPI protocol working but I've run into a new issue. When trying to control many LED's I get this error: "SPI count for read and write operations have a limit of 144 for a data precision of 'uint8" and as a result can only control up to 28 LEDs. What is this cap and is there a way to increase it? If not, what alternative do I have to control up to 3-400 LED's?
Thanks in advance
Madhu Govindarajan
Madhu Govindarajan on 30 Oct 2017
Have you tried using the Simulink support package for Arduino? That might eliminate the I/O issue you could be facing here.

Sign in to comment.

Answers (0)

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!