00: Getting Started

    Installation

    The first thing you must do is install the Arduino IDE (Integrated Development Environment). The installer can be found here, and the official getting started guide can be found here. Follow the getting started guide through to the end and see the blinking light. Once done, you will be in a position to start learning about how to actually program an Arduino, and what the various commands do.

    Program Structure

    All Arduino programs have the same structure. First, there is one function that is executed once when the hardware is first powered on. Second, there is one function that is executed repeatedly, as long as the hardware stays powered on. These functions are called setup and loop, respectively.

    The setup() Function

    Code in the setup() function gets executed exactly once when the hardware is powered on. Some common tasks that are performed in the setup() function are:

    • Setting pin modes (Input or Output).
    • Initializing a serial port.
    • Other one-time initialization.

    The loop() Function

    Code in the loop() function gets executed repeatedly, as long as the hardware is powered on.

    Arduino Program Skeleton

    // Global Variables
    
    void setup()
    {
        // Program Initialization
    }
    
    void loop()
    {
        // Program Execution
    }
    Tag page (Edit tags)
    • No tags
    Pages that link here
    Page statistics
    1178 view(s), 7 edit(s) and 2185 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments