bartoszbielawski / LEDMatrixDriver

A replacement for Arduino's LedControl library
MIT License
74 stars 25 forks source link

The comment about which pins to use in unclear #10

Closed Bielousov closed 6 years ago

Bielousov commented 6 years ago

The comment about pins selection is very unclear and conflicting in all example sketches, i.e. here

> Define the ChipSelect pin for the led matrix

> (Dont use the SS or MISO pin of your Arduino!)

> "MOSI=DIN of the LEDMatrix and CLK"

Please provide more guidance on selecting pins, perhaps with example using the most popular Arduino Uno and MAX7219 matrix.

moette commented 6 years ago

I feel you need to learn about SPI first. :) Check this page: https://www.arduino.cc/en/Reference/SPI (It is also referenced in the comment you marked.)

For your example: (@bartoszbielawski : Maybe you can add it to the readme?)

MAX7219 driven LED Matrix usually requires 3 signals:

On the Arduino Uno MOSI is on pin D11 and CLK on pin D13. You can use any digital capable pin of your Adruino for ChipSelect (CS) as long as it is not one of the SPI pins or used by other technologies: eg. using D0 and D1 would be possible but break your Serial Interface.

Pin D9 is not used for SPI on the UNO. Again see: https://www.arduino.cc/en/Reference/SPI Same page is referenced in the comment.

(Dont use the SS or MISO pin of your Arduino!): Why? What would happen if I use one of those?

... you would break SPI ;-) - It is not going to destroy anything but it won't work.