Ryu Kaz
/
767zi
t6est
Diff: peripheral.cpp
- Revision:
- 3:8b22783f6bf1
- Parent:
- 0:3dc012104243
- Child:
- 4:9ba47e5db1e2
--- a/peripheral.cpp Wed Sep 25 07:47:37 2019 +0000 +++ b/peripheral.cpp Thu Sep 26 02:23:27 2019 +0000 @@ -21,7 +21,7 @@ Serial peri_serial(USBTX,USBRX); -int a= 100; +int a= 150; int color = 0; int peri_which = 0; @@ -59,9 +59,8 @@ int read_peri(){ int seven = DD7.read(); int six = DD6.read(); - if(seven)peri_which = 0; - else if(!seven && six)peri_which = 1; - else if(!seven && !six)peri_which = 2; + if(six)peri_which = 1; + else if(!six)peri_which = 2; color = DD5.read(); peri_serial.printf("%d\n",color); if(!peri_which)return(8); @@ -70,7 +69,10 @@ else return(8); } - +int getPeriwhich(){ + if(peri_which == 1)return(0); + else return(1);//towel + } void changeColor(int *p){ if(color == 0){//blue inarray(&points_blue[0][0],p,peri_which); @@ -78,7 +80,9 @@ inarray(&points_orange[0][0],p,peri_which); } } - +int getColor(){ + return(color); + } int read_keter(){ int a = Dketer.read(); if(a)return(1);