Coding With Arduino

  • Upload
    prabhat

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

  • 7/24/2019 Coding With Arduino

    1/19

    INTRODUCTION TOEMBEDDED C

  • 7/24/2019 Coding With Arduino

    2/19

    What is Embedded C?

    Embedded C is nothing but a subset of Clanguage which is compatible with certainmicrocontrollers.

    Some features are added using header les like, .

    scanf!" and printf!" are removed as the inputs arescanned from the sensors and outputs are given

    to the ports.

    Control structures remain the same like if#statement, for loop, do#while etc.

  • 7/24/2019 Coding With Arduino

    3/19

    Development process of Embedded C

    projects $rite C programs in %&' Studio ()E!(ntegrated

    )evelopment Environment"

    Compile them into a .he* le using the %&'#+CCcompiler !which integrates into %&' Studio"

    Simulate the target %&' program and debug thecode within %&' Studio

    rogram the actual chip using the -Sasp device,which is attached to our target board with aspecial #pin cable

    0nce programmed, the chip runs the program inour circuit

  • 7/24/2019 Coding With Arduino

    4/19

    If-statement

    Snta*1

    if! condition"

    2 statement33.4

    else

    2 statement33..

    4

  • 7/24/2019 Coding With Arduino

    5/19

    Do- while statement

    Snta*1

    (nitial counter

    )o

    2 statement33.

    update statement

    4

    $hile!condition"5

  • 7/24/2019 Coding With Arduino

    6/19

    For- statement

    Snta*1

    6or! initial counter5 test condition5 update stmt"

    2

    statement33.. statement33...

    4

    rogram1

    for!int i785i

  • 7/24/2019 Coding With Arduino

    7/19

    Creation of Arduino Projects

  • 7/24/2019 Coding With Arduino

    8/19

    Home screen of Arduino

  • 7/24/2019 Coding With Arduino

    9/19

    Creation of new !etch

  • 7/24/2019 Coding With Arduino

    10/19

    Codin"

    window

  • 7/24/2019 Coding With Arduino

    11/19

    Compilation the code

  • 7/24/2019 Coding With Arduino

    12/19

    Compile

    tatus

    If there is no error

    in the code the

    compile

    succeeded

    without any error.

  • 7/24/2019 Coding With Arduino

    13/19

    ow to burn the sketch lein %rduino oard

  • 7/24/2019 Coding With Arduino

    14/19

    Connect one end of our -S Cable with

    Computers -S ort and connect other endwith the %rduino board.

  • 7/24/2019 Coding With Arduino

    15/19

    Click on to the button ?Serial ort.

  • 7/24/2019 Coding With Arduino

    16/19

    rowse our oard to be used. ere we will be

    using Arduino NG older w At!e"a#

  • 7/24/2019 Coding With Arduino

    17/19

    6inall click on to the -pload button to burn

    thes$etc%le in the %rduino oard.

  • 7/24/2019 Coding With Arduino

    18/19

  • 7/24/2019 Coding With Arduino

    19/19

    T&AN' (OU