Page 190 - 15 Dangerously Mad Projects for the Evil Genius
P. 190

Chapter 13    ■  Levitation Machine     167


        Step 7. Set Up Your Computer                       at www.dangerouslymad.com, into a new project
        with Arduino                                       (see Figure 13-13), and then save the sketch as
                                                           antigravity. The word “sketch” denotes a program
        To be able to program your Arduino board with the
                                                           in Arduino parlance.
        control software for the levitator, you first need to
                                                             To actually upload the software onto the
        install the Arduino development environment on
                                                           Arduino board so it can function without the
        our computer. If you completed the persistence-of-
                                                           computer, click the Upload button on the toolbar.
        vision project of Chapter 8, you will already have
                                                           There will now be a furious flashing of little lights
        the Arduino software setup.
                                                           on the board as the program is installed on the
           For installation and setup instructions, please
                                                           Arduino board.
        refer back to Chapter 8 and the Arduino web site
                                                             Before we make something to levitate and try
        (www.arduino.cc).
                                                           the project out for real, we can carry out a few
                                                           tests to make sure the sensor and LED are working
        Step 8. Program the Arduino Board
                                                           okay. To do this, we will use the Arduino
        Without connecting the power supply to the board,  software’s Serial Monitor. This allows your
        connect a USB cable between your computer and      computer and the Arduino board to communicate.
        the Arduino board. You should see the red power    So you can issue commands to the Arduino, and
        LED come on, and if it is a new board, a small     the Arduino can also send back data.
        LED in the middle of the board will be flashing      Click the Serial Monitor (the rightmost icon on
        slowly.                                            the toolbar) and after the prompt appears, type m
           Launch the Arduino software. Copy and paste     into the text entry box at the top of the monitor
        the code for the application, which can be viewed  (Figure 13-14).





































         Figure 13-13  Loading the antigravity sketch
   185   186   187   188   189   190   191   192   193   194   195