2 Cisco Packet Tracer Blinking a LED using Blockly Objectives
Video Tutorial on Cisco Packet Tracer Blinking a LED using Blockly Objectives Download Packet Tracer / Reference : www.netacad.com 1) Enable a blinking Led using Blockly Objectives 2) Create RGB Combination Color Output Download Packet Tracer : www.netacad.com Lab – Blinking an LED Using Blockly Objectives Part 1: Open Packet Tracer and Examine Blockly Program for LED Blinking Part 2: Control a RGB LED using Blockly Use Packet Tracer 7.2 for IOT activities. Background Blockly is a visual programming language that lets users create programs by connecting blocks, that represent different logic language structures, rather than by writing the actual code. Blockly runs within a web browser and can translate the visually created program as JavaScript, PHP, or Python. In this lab, you will use Blockly to examine Blockly programming and to control an LED. Scenario Using Blockly programming to control an IoT object LED. In this lab, Cisco Packet Tracer is used as it provides Blockly support with IoT objects. Required Resources • Cisco Packet Tracer 7.1.1 and above is installed and available. Part 1: Launch Cisco Packet Tracer (PT) and Use Blockly In Part 1, you will access the Cisco Packet Tracer program and examine LED control using Blockly programming. Step 1: Launch Packet Tracer. a. Double click the Cisco Packet Tracer icon to open the PT program. b. The user interface is shown. Lab - Blinking an LED using Blockly c. Click on the Components category, then click MCU Board and drag it to the workspace. Lab - Blinking an LED using Blockly d. Click the subcategory Actuators, select LED and drag it to the workspace. e. Click the Connections category, select IoT Custom Cable to link MCU at port D1 and LED at port D0. Lab - Blinking an LED using Blockly f. Double click the MCU. Its configuration window displays. g. Click the Programming tab. (If you do not see the Programming tab, click the Advanced button at the lower right corner.) Step 2: Examine a prebuilt Blockly program a. Under the note No Project Opened, click New. In the Create Project window, enter Blinking LED as the project name. In the Template dropdown menu, select Blink – Visual. b. Click Create. Lab - Blinking an LED using Blockly c. Double-click main.visual. The prebuilt Blockly program displays. d. Click Run. Does the LED blink? e. Click Stop, and change the Value field of the first digitalWrite block to 1023. f. Click Run, does the LED blink? Why was it not blinking when the value was not set to 1023? Lab - Blinking an LED using Blockly g. Click the LED and study its specification. h. It indicates that we can use “analogWrite” to adjust the device brightness. Click the first digitalWrite block and press Delete. Expand the Pin Access group and drag an analogWrite block to to where the digitalWrite block was. Do the same for the second digitalWrite block. i. Change the slot value for each of the analogWrite blocks to 1. Right-click the small block with the value of zero (0) and click duplicate. Drag the new block into the empty space next to value. Do the same for the second analogWrite slot. Lab - Blinking an LED using Blockly j. Change the values of the first and second analogWrite blocks and observe the different LED brightness levels.
Download
0 formatsNo download links available.