For IEEE Robotics
Dependencies: Adafruit-16-Ch-PWM-Servo-Driver HCSR04 PID PololuQik2 QEI Sharp mbed-rtos
Diff: ShapeDetect.cpp
- Revision:
- 16:8bb212df81b7
- Parent:
- 15:78f5e937f6ab
- Child:
- 17:a5bb85ee205d
diff -r 78f5e937f6ab -r 8bb212df81b7 ShapeDetect.cpp --- a/ShapeDetect.cpp Wed Apr 02 04:04:28 2014 +0000 +++ b/ShapeDetect.cpp Wed Apr 02 23:54:05 2014 +0000 @@ -285,10 +285,13 @@ pc.printf("Center of Mass is at X: %d Y: %d\n\r", xcoord_val, ycoord_val, s_area_val); pc.printf("The area of the Mass is: %d\n\r", s_area_val); - if( (s_area_val > (SQUARE_AREA - AREA_TOLERANCE)) && (s_area_val < (SQUARE_AREA + AREA_TOLERANCE)) ) { + //if( (s_area_val > (SQUARE_AREA - AREA_TOLERANCE)) && (s_area_val < (SQUARE_AREA + AREA_TOLERANCE)) ) { + if( (s_area_val > 3500) ) { pc.printf("\nSQUARE DETECTECD\n\r"); return 1; - } else if ((s_area_val > (TRIANGLE_AREA - AREA_TOLERANCE)) && (s_area_val < (TRIANGLE_AREA + AREA_TOLERANCE)) ) { + } + //else if ((s_area_val > (TRIANGLE_AREA - AREA_TOLERANCE)) && (s_area_val < (TRIANGLE_AREA + AREA_TOLERANCE)) ) { + else if (s_area_val < 2600) { pc.printf("\nTRIANGLE DETECTECD\n\r"); return 2; } else {