veroxzik / arduino-psx-controller

Use an Arduino (ATmega32U4-based) board as a Playstation 1 / 2 Controller.
MIT License
20 stars 7 forks source link

Leonardo default pins not working #4

Open rodesch-ryan opened 1 year ago

rodesch-ryan commented 1 year ago

I attempted to use this library with an Arduino Leonardo, but was unable to get the pins to work. It looks like the library may not be accounting for the differences in the Leonardo's pins if my deductive reasoning isn't failing me. image The pins on the Leonardo don't seem to match the ones listed in the file. image I'm unsure of how to solve this issue and thought I'd bring it to your attention

veroxzik commented 1 year ago

Sorry for the insanely long delay on this issue.

You are correct that the current Leonardo pinout references these pins (D10-D13) as SPI, but to be honest with you, I don't believe them. Unless a new revision of Leonardo has come out past R3 (I can't find anything to suggest this is the case), then I assume Arduino expects you to use software SPI to access these four pins, which this library does not use for performance reasons.

The image below has the pinout I referenced and cross-checked with Arduino's previous schematics, and as far as I'm aware, is correct for the Leonardo. The hardware SPI pins are shown in purple. Arduino Leonardo Pinout