Tobis Programm forked to not destroy your golden files
Fork of Robocode by
Diff: source/Grabbing.cpp
- Revision:
- 116:e03a3692cdf0
- Parent:
- 114:720dc5df42a5
--- a/source/Grabbing.cpp Wed May 10 07:45:33 2017 +0000 +++ b/source/Grabbing.cpp Wed May 10 08:52:04 2017 +0000 @@ -32,6 +32,9 @@ grabbing_state = 4; break; case 4: + if(move_for_distance(0) < 0.075f) { + close_grabber_half(); + } if(move_for_distance(0) < 0) { grabbing_state = 5; } @@ -121,6 +124,11 @@ set_servo_position(8, servo8min); } +void close_grabber_half() +{ + set_servo_position(8, ((servo8min+servo8max)/2)); +} + void close_grabber() { set_servo_position(8, servo8max);