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: bloques ball mbed WS2812 PixelArray tsi_sensor TSI bloque MMA8451Q
Revision 16:eab9a8d27969, committed 2021-05-25
- Comitter:
- anna_dot
- Date:
- Tue May 25 16:28:33 2021 +0000
- Parent:
- 15:706dd4761fbe
- Child:
- 17:0ecf3108f79e
- Commit message:
- bugs fixed related to rebote
Changed in this revision
| ball.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ball.lib Mon May 24 19:42:13 2021 +0000 +++ b/ball.lib Tue May 25 16:28:33 2021 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/anna_dot/code/ball/#49397aed5f72 +https://os.mbed.com/users/anna_dot/code/ball/#0960aa79c2de
--- a/main.cpp Mon May 24 19:42:13 2021 +0000
+++ b/main.cpp Tue May 25 16:28:33 2021 +0000
@@ -317,20 +317,20 @@
bool found_barra=false;
int i=0;
if(old_i==15){
-
+ //pc.printf("TECHO Angle ANTES REBOTE --> %d \r\n", angle);
direct_ball=!direct_ball;
angle_rebote();
-
+ //pc.printf("TECHO Angle DESPUES REBOTE --> %d \r\n", angle);
}
else{
- if( (old_j==15 or old_j==0) and (angle!=1) and old_i!=1){
- pc.printf("Angle ANTES REBOTE --> %d \r\n", angle);
+ if( (old_j==15 or old_j==0) and (angle!=1)){ //and old_i!=1){
+ //pc.printf("PAREEEED Angle ANTES REBOTE --> %d \r\n", angle);
angle_rebote();
- pc.printf("Angle DESPUES REBOTE --> %d \r\n", angle);
+ //pc.printf("PAREEEED Angle DESPUES REBOTE --> %d \r\n", angle);
- }else{
+ }//else{
int predict_Y=m_ball.predict_Y_axis_barra(direct_ball, angle);
-
+ pc.printf("\r\n Coord X %d, Coord Y %d y predictY %d, angle %d, direction %d --> ",m_ball.getCoordX(), m_ball.getCoordY() , predict_Y, angle, direct_ball );
while(!found_barra and i<NUM_LEDS_BARRA){
if(barra[i]==predict_Y and old_i==1){
found_barra=true;
@@ -354,7 +354,7 @@
lose=true;
}
- }
+ //}
}
/*if((barra[0]==old_j or barra[1]==old_j or barra[2]==old_j or barra[3]==old_j) and old_i==1){
@@ -377,7 +377,7 @@
int j=0;
if(found_blq_i){
int predict_Y=m_ball.predict_Y_axis(direct_ball, angle);
- pc.printf("\r\n Coord X %d, Coord Y %d y predictY %d --> \n",m_ball.getCoordX(), m_ball.getCoordY() , predict_Y );
+ //pc.printf("\r\n Coord X %d, Coord Y %d y predictY %d, angle %d, direction %d --> ",m_ball.getCoordX(), m_ball.getCoordY() , predict_Y, angle, direct_ball );
while(!found_blq_j and j<Bloques.getNumBloques() ){
bloque temp_blq=Bloques.getBloque(j);
int blq_pos_Y=(temp_blq.getCoordY()+temp_blq.getSize());
