Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 70 - Robo_Genius_V1.0_flipbook_C4
P. 70

    Step 6   Connect micro:bit to its cable and USB port of computer/laptop.

                      Step 7   Micro:bit is connecting with the computer/laptop. Now click on the
                                 download button to upload the code inside the micro:bit.

                                      Click here

                      Output

                        The program uses a variable called “direction” to store a random number.

                          Variables store numbers or values that can change in a computer program.

                          Shake the micro:bit to set “direction” to a
                         random number between one and three.

                          The  program  then  uses  selection  and

                         comparison logic blocks to test the value of
                         the variable.

                          If “direction” is equal to 1, then an arrow
                         pointing north shows on the micro:bit’s LED

                           68    RoboGenius (V1.0)-IV

| 65 66 67 68 69 70 71 72 73 74 75 |