Page 169 - Computing E-Book Grade 6
P. 169

The City School  2021-2022




             Follow a Torch



                      Start


                      forever
                                                                                                                    Robotics
                       if      light level of  right light  sensor  >  light level of  left light  sensor  then


                         set both motor to  turn robot right  at speed  5

                       else

                         set both motor to  turn robot left  at speed  5







             Clap Control Driving





                            Start


                            clear clap detector      sensor data


                            forever


                               wait until  clap detected


                               clear clap detector     sensor data


                               wait  2   sec


                                     clap detected   then


                                forwards for  30   cm     at speed   5

                               else

                                        turn forwards   right  90     degrees      at speed   5





                               clear clap detector     sensor data













                                                                                                               169
   164   165   166   167   168   169   170   171   172   173   174