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.
HIROSE.h
- Committer:
- nekoyyy
- Date:
- 2014-01-30
- Revision:
- 0:4682992b55fa
File content as of revision 0:4682992b55fa:
void motion(int a){
if(a==1){
men2=1;
dousa2=1;
pc.printf("hirose_men\n");
}
else if(a==2){
dou2=1;
dousa2=1;
hiro=1;
pc.printf("hirose_dou\n");
}
else if(a==3){
tuk2=1;
dousa2=1;
pc.printf("hirose_tuki\n");
}
else if(a==4){
bou2=1;
dousa2=1;
pc.printf("hirose_bougyo\n");
}
else;
}
void HIROSE(void const *argument) {
srand((unsigned int)time(NULL));
int ene=0;
int i=1;
int count=0;
int me=0;
float syatei1=0.3f;
float syatei2=0.5f;
int j=GetRandom(50,250);
while(1){
if(shin=='n'){
if(hirose==1){
if(dousa2==0){
if(dousa==0){
ene=0;
count=0;
}
else if((men==1)&&(count==0)){
ene=1;
me=GetRandom(1,3);
}
else if(bou==1)ene=2;
else if(dou==1)ene=3;
else if(tuk==1)ene=4;
else ene=0;
}else;
switch(ene){
case 0: //nanmositenai
if(i==1){
j=GetRandom(50,150);
}else;
if((psd>syatei1)&&(psd<syatei2)){
i++;
wait(0.02);
}
if(i==j){
motion(GetRandom(1,3));
i=1;
}else;
break;
case 1: //men
switch(me){
case 1: //bougyo
if((dousa2==0)&&(count==0)){
motion(4);
}
else if((fei>4)&&(fei2==3)){
fei2=2;
}
else if((fei<3)&&(fei2==3)){
fei2=2;
}else;
count++;
break;
case 2:
if((dousa2==0)&&(count==0)){
motion(3);
}else;
count++;
break;
case 3:
if((dousa2==0)&&(count==0)){
motion(2);
}else;
count++;
break;
}
break;
case 2: //bougyo
if(dousa2==0){
motion(2);
}else;
break;
case 3: //dou
if(dousa2==0){
motion(1);
}else;
break;
case 4: //tuki
if(dousa2==0){
motion(2);
}else;
break;
}
}else;
}else;
}
}