![](/media/cache/profiles/83bdd5a91e556ca3b57aafab83ee8ef5.50x50_q85.jpg)
Sample program of PS_PAD. ( https://developer.mbed.org/users/okini3939/code/PS_PAD/ ) Special thanks to Suga koubou(okini3939). Available for PlayStationController, VS-C1, VS-C3, etc...
Diff: main.cpp
- Revision:
- 0:1ede48b6ea40
diff -r 000000000000 -r 1ede48b6ea40 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 01 15:00:42 2015 +0000 @@ -0,0 +1,31 @@ +/* + * ====================== + * VS-C3/VS-RCV3 PIN + * ====================== + * 1:NC 2:NC + * 3:DAT 4:CMD + * 5:SEL 6:CLK + * 7:+5~7V 8:NC + * 9:+3V 10:GND + * + */ + +#include "mbed.h" +#include "PS_PAD.h" + +PS_PAD vsc3(p5, p6, p7, p21); + +DigitalOut myled[] = {LED1, LED2, LED3, LED4}; + +int main() { + vsc3.init(); + printf("START\n"); + while(1) { + vsc3.poll(); + myled[0] = vsc3.read(PS_PAD::PAD_CIRCLE); + myled[1] = vsc3.read(PS_PAD::PAD_SQUARE); + myled[2] = vsc3.read(PS_PAD::PAD_TRIANGLE); + myled[3] = vsc3.read(PS_PAD::PAD_X); + wait(0.05); + } +}