Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of PS3_BlueUSB_user_ver2 by
Diff: User.cpp
- Revision:
- 11:86d717718dbf
- Parent:
- 10:bf0c0cdb487d
- Child:
- 12:1254070d444a
- Child:
- 13:3d7a8cb91eeb
diff -r bf0c0cdb487d -r 86d717718dbf User.cpp
--- a/User.cpp Mon Feb 15 02:19:02 2016 +0000
+++ b/User.cpp Mon Feb 15 02:23:25 2016 +0000
@@ -12,10 +12,7 @@
PwmOut led2(LED2);
DigitalOut led3(LED3);
DigitalOut led4(LED4);
-DigitalOut LDB(p21);
-DigitalOut RDB(p22);
-SPI m(p5, p6, p7);
-DigitalOut cs(p8);
+
void UserLoopSetting(){
//一度だけ行いたい初期設定をここに書く
led1.period_ms(20);
@@ -44,49 +41,16 @@
}
//ここより下にプログラムを書く
//データ取得例
- int M=0;
- m.format(16,3);
- m.frequency(1000000);
- cs=0;
+
if((ButtonState >> BUTTONCIRCLE)&1) {
//○が押されたとき
}
- if((ButtonState >> BUTTONL2)&1){
- LDB=1;
- }
- else if((ButtonState >> BUTTONR2)&1){
- RDB=1;
- }
- else if((ButtonState >> BUTTONDOWN)&1){
- RDB=1;
- LDB=1;
- }
- if((ButtonState >> BUTTONR1)&1){
- M=+32768;
- }
- else if((ButtonState >> BUTTONL2)&1){
- M=+16384;
- }
- if(LSX-128>=0){
- M=+8192;
- M=+(LSX-128)*64;
- }
- else if(LSX-128<0){
- M=+(-1)*((LSX-128)*64);
- }
- if(LSY-128>=0){
- M=+64;
- M=+((LSY-128)/2);
- }
- else if(LSY-128<0){
- M=+((-1)*(LSY-128));
- }
- m.write(M);
+
led1=LSX/256.0f;
led2=LSY/256.0f;
led3=ButtonState & 0x0400; //L1の状態
led4=ButtonState & 0x0800; //R1の状態
//値の取得はps3.hを参照
- cs=1;
+
}
\ No newline at end of file
