プレステ1アナログコントローラ用ライブラリのサンプル
Diff: main.cpp
- Revision:
- 1:38674ebae5dc
- Parent:
- 0:ab4722670dd8
- Child:
- 2:c6f427909677
--- a/main.cpp Mon Sep 09 06:30:27 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -#include "mbed.h" -#include "pspad.h" - -Serial pc(USBTX, USBRX); -Pspad PS(PTB11,PTB10,PTB9,PTB8); -Timer LapTime; - -int main() { - pc.baud(921600); - while(1) { - PS.PsRead(); - - pc.printf("time:%d",LapTime.read_us()); - LapTime.start(); - - if(PS.BUTTON.BIT.MARU&&(0==PS.PREV.BUTTON.BIT.MARU)) PS.VIBRATE = 1-PS.VIBRATE; - pc.printf("%5d %5d", PS.BUTTON.BIT.MARU, PS.PREV.BUTTON.BIT.MARU); - pc.printf("%5d %5d %5d %5d %5d \r\n", PS.BUTTON.WORD, PS.right_x, PS.right_y, PS.left_x, PS.left_y); - } -} \ No newline at end of file