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 Nucleo_PS3_Jikken_PS3 by
Diff: main.cpp
- Revision:
- 22:ab619079fb8d
- Parent:
- 20:373fa71ce05b
- Child:
- 23:d5f7e3dab589
diff -r 373fa71ce05b -r ab619079fb8d main.cpp
--- a/main.cpp Fri Oct 16 09:32:02 2015 +0000
+++ b/main.cpp Sat Oct 17 05:44:35 2015 +0000
@@ -23,7 +23,6 @@
#define TNL 150
#define debugFlag 1
#define stopCount 33
-#define shotWait 0.2
Serial pc(SERIAL_TX, SERIAL_RX);
//Serial Dev(D8,D2);//コントローラー
@@ -256,7 +255,7 @@
//射出
if(getBt(btL)&&obonFlag){
kRed=shotToDenziben(airReg,1,1,airAddr);
- wait(shotWait);
+ wait(0.5f);
kRed=shotToDenziben(airReg,0,1,airAddr);
kRed=0;
}
@@ -264,7 +263,7 @@
//射出
if(getBt(btR)&&obonFlag){
kRed=shotToDenziben(airReg,2,1,airAddr);
- wait(shotWait);
+ wait(0.5f);
kRed=shotToDenziben(airReg,0,1,airAddr);
//printf("shot:%d\r\n",i2cS=i2c.write(airAddr,cmd,2));
//i2c.write(airAddr,cmd,2);
@@ -274,7 +273,7 @@
//射出
if(getBt(btTri)&&obonFlag){
kRed=shotToDenziben(airReg,4,1,airAddr);
- wait(shotWait);
+ wait(0.5f);
kRed=shotToDenziben(airReg,0,1,airAddr);
kRed=0;
}
@@ -288,26 +287,26 @@
else if(!getBt(btSqa))
sqf=1;
- //レーザーセンサ
- if(!((int)DATA[1]&2)==2&&!((int)DATA[1]%1)==1){
- //Mechanum.putc(162);
+ //タッチセンサ
+ if(((int)DATA[1]&12)==12){
+ bValue=0;gValue=0.8;rValue=0;
}
//お盆回し
if(getPress(presUp)){
obonFlag=true;
+ Mechanum.putc(162);
rValue=0.8;gValue=0;bValue=0.8;
kRed=0;
+ wait(0.2);
}
else if(getPress(presDown)){
+ Mechanum.putc(163);
bValue=0.8f;gValue=0;rValue=0;
obonFlag=false;
kRed=0;
- }
- else{
- bValue=0.8f;gValue=0;rValue=0;
- }
-
+ wait(0.2);
+ }
deg=devidePoint((double)DATA[3],(double)DATA[2],15,360/devideNum);
if(getPress(btSel)||(detFinF&°!=devideNum)){
