Configure the hardware and the diagram

1.    Set up the hardware by attaching the pushbutton sensor to the GRND, 3.3 V and digital input 2 pins on the Arduino Uno R3.


2.    Attach the Uno to your computer using a USB cable.

3.    Start Embed and click File > New.

4.    Save the diagram as BlinkLEDwithPushButton.vsm.

5.    Add an Arduino Config block, Digital Input for Arduino block, and Digital Output for Arduino block to your diagram.


6.    Wire the Digital Input for Arduino block into the Digital Output for Arduino block and make sure:

      The Arduino Config is set to the proper COMM port.

      The Digital Input for Arduino is set to channel 2 and port PD.

      The Digital Output for Arduino is set to channel 2 and port PB.

7.    Generate code to run on the Arduino.

8.    After the code has been downloaded to the Arduino Uno R3, click the pushbutton on the sensor. The built-in LED fails to respond when pushing the sensor button.

The next several sections step you through how to debug the code using the Arduino serial monitor.