Page 101 - KEC Khaitan C5 Flipbook
P. 101

Step 12  Drag  the  call  Pedometer1.Start block  to the
                           workspace and connect it to Button1.Click.

                 Similarly,  for  Button2, drag the  when  Button2.Click event
                 block  to  the workspace,  then drag the  call  Pedometer1.Stop
                 block and connect it to Button2.Click.

                 Step 13  Drag the when Button3.Click block to the workspace.

                 Step 14  Drag the call Pedometer1.Reset block to the workspace and connect it to Button3.
                           Click.
                 Step 15  Click on the            block.

                           The list of coding blocks appears.

                 Step 16  Drag set Label1.Text to and attach the               0 inside it.
                 Step 17  Click on the               block.

                           The list of coding blocks appears

                 Step 18  Drag the when Pedometer1.SimpleStep block to the workspace.
                 Step 19  Click on the            block.

                           The list of coding blocks appears.

                 Step 20  Drag the  set Label1.Text  to block  to  the  workspace  and connect  it  to  when
                           Pedometer1.SimpleStep.
                 Step 21  Click on simpleSteps, and a drop-down list will appear.

                 Step 22  Drag get simpleSteps and attach it inside set Label1.Text to.













                 Testing the Pedometer App
                 App Inventor allows us to test our app while creating, so to

                 test your app, connect your android device and download
                 MI A12 companion.
                 Step  1   Click on the Connect menu.

                 Step  2   Click on AI Companion from the drop-down list.
                           The Connect to Companion message box appears.

                 Step  3   Open  MIT  A12 Companion on your device  and
                           connect by scanning the QR code or typing the
                           code displayed on your screen.



                                                                                       Sensors and App Functionality  99
   96   97   98   99   100   101   102   103   104   105   106