arduino-psx-controller icon indicating copy to clipboard operation
arduino-psx-controller copied to clipboard

Porting the library

Open eduardokenj opened this issue 3 years ago • 8 comments

If possible port the library for another AVR microcontroller (ex: 328p)?

eduardokenj avatar Sep 01 '22 12:09 eduardokenj

Shouldn't be too much of an issue. I'll see if I can get to it this weekend. I don't think I have anything other than a 328p to test though.

veroxzik avatar Sep 02 '22 00:09 veroxzik

@eduardokenj Can you test this branch and let me know if it works? https://github.com/veroxzik/arduino-psx-controller/tree/feat/328p

veroxzik avatar Sep 18 '22 17:09 veroxzik

Sorry for the delay, but the lib not work in 328p microcontrollers. I got that error on my IDE, when i compile on 328p 8MHz (aka Pro Mini): C:\Users\eduar\Documents\Arduino\libraries\arduino-psx-controller-feat-328p\src\arduino_psx.cpp: In member function 'void PSX_::init(int, bool, bool)': C:\Users\eduar\Documents\Arduino\libraries\arduino-psx-controller-feat-328p\src\arduino_psx.cpp:36:19: error: 'SPR2' was not declared in this scope SPCR |= (1 << SPR2) | (1 << SPR1); // Fosc/32 @8MHz==250KHz ^~~~ C:\Users\eduar\Documents\Arduino\libraries\arduino-psx-controller-feat-328p\src\arduino_psx.cpp:36:19: note: suggested alternative: 'SPR0' SPCR |= (1 << SPR2) | (1 << SPR1); // Fosc/32 @8MHz==250KHz ^~~~ SPR0 image

And when compile the code okay on 328p 16MHz, i tested in my arduino pro mini and uno, in both situations PS1 and PS2 not work.

eduardokenj avatar Sep 26 '22 00:09 eduardokenj

Hi I'd like to add support for the joysticks if that's ok?

djsedaw avatar Aug 17 '24 08:08 djsedaw

Hi I'd like to add support for the joysticks if that's ok?

@djsedaw Go for it.

veroxzik avatar Aug 19 '24 00:08 veroxzik

Hi, all going well, one question, do you think the micro has enough pins for 4 d-pad buttons, 4 on the right, start and select, L1 and L2, R1 and R2, L3 and R3 which are the buttons on the 2 joysticks, plus the 4 pins for the spi?

djsedaw avatar Aug 30 '24 07:08 djsedaw

I was looking at the raspberry pi Pico board which has enough pins but only 3 analog pins, which means I would need a ADS1115 to increase the analog pins

djsedaw avatar Aug 30 '24 08:08 djsedaw

Sorry 5 pins for the spi

djsedaw avatar Aug 30 '24 11:08 djsedaw