Arduino Exercises

download Arduino Exercises

of 2

Transcript of Arduino Exercises

  • 8/16/2019 Arduino Exercises

    1/2

    Interfacing Exercises

    1. Create a program and interface to turn on three lights. The rst light should be controlledby pin 2, the second light should be controlled by pin 3, and the third light should becontrolled by pin 4. Lights should turn on (one at a time by their corresponding !eysentered by the user.

    2. Create a program and interface that simulates the logic of an "# gate. The user may enter

    1, 2, 3, or $ (to put 1, 2, both, or no inputs on high. %f either or both inputs are high, thethird light should come on, as &ell as the necessary input lights.

    3. Create a program and interface that simulates the logic of an '"# gate. The user mayenter 1, 2, 3, or $ (to put 1, 2, both, or no inputs on high. %f either inputs are high, the thirdlight should come on, as &ell as the necessary input lights. %f both or no inputs are high, thethird light should be o, &ith the necessary input lights on.

    4. Create a program and interface to turn on three lights in a for&ards chase. )ach lightshould stay on for appro*imately 1 second.

    +. Create a program and interface to turn on three lights in a reerse chase. )ach light should

    stay on for appro*imately 1 second.

    -. Create a program and interface to turn on three lights in a for&ards and reerse chase.ser should input a 1 for the for&ard chase and 2 for the reerse chase. )ach light shouldstay on for appro*imately 1 second. /t the end of one chase, the user may input again torun the chase for&ards or bac!&ards.

    0. Create a program and interface that controls a motor using a po&er transistor. The usershould be able to control the motor starting and stopping using inputs from the !eyboard.

    lease note you must demonstrate to me the programming running after each e*ercise. /llcode my be fully commented.

  • 8/16/2019 Arduino Exercises

    2/2