@@ -64,16 +64,16 @@ bool turn = true; // True to turn clockwise, false to turn counter-clockwise
6464ImageFloatBox box (0.56 , 0.724 , 0.012 , 0.024 ); // Create a box that contains both green and blue arrows that need to be detected
6565
6666void TurnClockwiseSlow (BotBaseContext& context){ // One turn of stiring poffin at slow speed (clockwise)
67- pbf_move_right_joystick (context, 128 , 255 , 4 , 0 );
68- pbf_move_right_joystick (context, 53 , 231 , 4 , 0 );
69- pbf_move_right_joystick (context, 6 , 167 , 4 , 0 );
70- pbf_move_right_joystick (context, 6 , 88 , 4 , 0 );
71- pbf_move_right_joystick (context, 53 , 24 , 4 , 0 );
72- pbf_move_right_joystick (context, 128 , 0 , 4 , 0 );
73- pbf_move_right_joystick (context, 202 , 24 , 4 , 0 );
74- pbf_move_right_joystick (context, 249 , 88 , 4 , 0 );
75- pbf_move_right_joystick (context, 249 , 167 , 4 , 0 );
76- pbf_move_right_joystick (context, 202 , 231 , 4 , 0 );
67+ pbf_move_right_joystick (context, 128 , 255 , 5 , 0 );
68+ pbf_move_right_joystick (context, 53 , 231 , 5 , 0 );
69+ pbf_move_right_joystick (context, 6 , 167 , 5 , 0 );
70+ pbf_move_right_joystick (context, 6 , 88 , 5 , 0 );
71+ pbf_move_right_joystick (context, 53 , 24 , 5 , 0 );
72+ pbf_move_right_joystick (context, 128 , 0 , 5 , 0 );
73+ pbf_move_right_joystick (context, 202 , 24 , 5 , 0 );
74+ pbf_move_right_joystick (context, 249 , 88 , 5 , 0 );
75+ pbf_move_right_joystick (context, 249 , 167 , 5 , 0 );
76+ pbf_move_right_joystick (context, 202 , 231 , 5 , 0 );
7777}
7878
7979void TurnClockwiseFast (BotBaseContext& context){ // Same as above, but faster for the end of the cooking session
@@ -89,16 +89,16 @@ void TurnClockwiseFast(BotBaseContext& context){ // Same as above, but faster fo
8989
9090
9191void TurnCounterClockwiseSlow (BotBaseContext& context){ // One turn of stiring poffin (counter-clockwise)
92- pbf_move_right_joystick (context, 128 , 255 , 4 , 0 );
93- pbf_move_right_joystick (context, 202 , 231 , 4 , 0 );
94- pbf_move_right_joystick (context, 249 , 167 , 4 , 0 );
95- pbf_move_right_joystick (context, 249 , 88 , 4 , 0 );
96- pbf_move_right_joystick (context, 202 , 24 , 4 , 0 );
97- pbf_move_right_joystick (context, 128 , 0 , 4 , 0 );
98- pbf_move_right_joystick (context, 53 , 24 , 4 , 0 );
99- pbf_move_right_joystick (context, 6 , 88 , 4 , 0 );
100- pbf_move_right_joystick (context, 6 , 167 , 4 , 0 );
101- pbf_move_right_joystick (context, 53 , 231 , 4 , 0 );
92+ pbf_move_right_joystick (context, 128 , 255 , 5 , 0 );
93+ pbf_move_right_joystick (context, 202 , 231 , 5 , 0 );
94+ pbf_move_right_joystick (context, 249 , 167 , 5 , 0 );
95+ pbf_move_right_joystick (context, 249 , 88 , 5 , 0 );
96+ pbf_move_right_joystick (context, 202 , 24 , 5 , 0 );
97+ pbf_move_right_joystick (context, 128 , 0 , 5 , 0 );
98+ pbf_move_right_joystick (context, 53 , 24 , 5 , 0 );
99+ pbf_move_right_joystick (context, 6 , 88 , 5 , 0 );
100+ pbf_move_right_joystick (context, 6 , 167 , 5 , 0 );
101+ pbf_move_right_joystick (context, 53 , 231 , 5 , 0 );
102102}
103103
104104void TurnCounterClockwiseFast (BotBaseContext& context){ // Same as above, but faster for the end of the cooking session
@@ -146,17 +146,17 @@ void PoffinCooker::program(SingleSwitchProgramEnvironment& env, BotBaseContext&
146146 pbf_wait (context, 1050 );
147147 context.wait_for_all_requests ();
148148
149- env.log (" Stir slowly for the first half " );
150- for (uint16_t d = 0 ; d < 85 ; d++){
149+ env.log (" Stir slowly for the first part " );
150+ for (uint16_t d = 0 ; d < 79 ; d++){
151151 // Capture the image on the screen
152152 VideoSnapshot screen = env.console .video ().snapshot ();
153153
154154 // Get the stats of the screen's image
155155 ImageStats IMGstats = image_stats (extract_box_reference (screen, box));
156- if (IMGstats.average .g > 200 && IMGstats.average .r < 100 ) { // Looking for the green arrow
156+ if (IMGstats.average .g > 170 && IMGstats.average .r < 125 ) { // Looking for the green arrow
157157 turn = true ;
158158 }
159- if (IMGstats.average .b > 200 && IMGstats.average .r < 100 ) { // Looking for the blue arrow
159+ if (IMGstats.average .b > 170 && IMGstats.average .r < 125 ) { // Looking for the blue arrow
160160 turn = false ;
161161 }
162162 if (turn){
@@ -173,10 +173,10 @@ void PoffinCooker::program(SingleSwitchProgramEnvironment& env, BotBaseContext&
173173
174174 // Get the stats of the screen's image
175175 ImageStats IMGstats = image_stats (extract_box_reference (screen, box));
176- if (IMGstats.average .g > 200 && IMGstats.average .r < 100 ) { // Looking for the green arrow
176+ if (IMGstats.average .g > 170 && IMGstats.average .r < 125 ) { // Looking for the green arrow
177177 turn = true ;
178178 }
179- if (IMGstats.average .b > 200 && IMGstats.average .r < 100 ) { // Looking for the blue arrow
179+ if (IMGstats.average .b > 170 && IMGstats.average .r < 125 ) { // Looking for the blue arrow
180180 turn = false ;
181181 }
182182 if (turn){
0 commit comments