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...

Dependencies:   PS_PAD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002  * ======================
00003  * VS-C3/VS-RCV3 PIN
00004  * ======================
00005  * 1:NC  2:NC
00006  * 3:DAT 4:CMD
00007  * 5:SEL 6:CLK
00008  * 7:+5~7V 8:NC
00009  * 9:+3V 10:GND
00010  *
00011  */
00012 
00013 #include "mbed.h"
00014 #include "PS_PAD.h"
00015 
00016 PS_PAD vsc3(p5, p6, p7, p21); 
00017 
00018 DigitalOut myled[] = {LED1, LED2, LED3, LED4};
00019 
00020 int main() {
00021     vsc3.init();
00022     printf("START\n");
00023     while(1) {
00024         vsc3.poll();
00025         myled[0] = vsc3.read(PS_PAD::PAD_CIRCLE);
00026         myled[1] = vsc3.read(PS_PAD::PAD_SQUARE);
00027         myled[2] = vsc3.read(PS_PAD::PAD_TRIANGLE);
00028         myled[3] = vsc3.read(PS_PAD::PAD_X);
00029         wait(0.05);
00030     }
00031 }