Absolutely typical... I wrote that post, then decided to try again... and of course, it works! Guess I must have had a loose connection somewhere...
Thanks for the library! Keep up the good work
Actually there is a problem.
I can use the analogs (both of them) and get sane results. I can then map these values to 0-180 degrees for use with a servo. However, if I try to write the servo inside the loop() function, everything falls apart.
If I try to turn on the analog it flashes briefly on, then turns off (the red light, that is). Even without the servo, the controller starts up in digital mode (despite being set up to start in analog mode), but I can press the analog button and put it into analog mode.
So it seems the servo write is messing things up - any ideas why? Something to do with timers or some such?
Code is below:
PSX.mode(PSX_PAD1, MODE_ANALOG, MODE_LOCK);
// Poll current state once.
// THIS WORKS
byte b = ANALOG_LEFT_Y(PSX_PAD1);
// THIS WORKS TOO
b = map(b, 0, 255, 0, 178);
// WITHOUT THIS, VALUES FOR b READ OVER SERIAL ARE FINE
// WITH IT, NOTHING WORKS!
Needed a separate power supply for the servos... sorted now. And learned the lesson that servos don't like having their polarity reversed... oops. Ah well, won't be making that mistake again!