Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C CODE ONLY! *******ONLY USE while loop! no other loop!******** Sample code I was given. build the code exactly like the one below. 1. Complete

C CODE ONLY!

*******ONLY USE while loop! no other loop!********

image text in transcribed

Sample code I was given. build the code exactly like the one below.

image text in transcribed

1. Complete Lab Exercise 2: Lights On - Lights Off. 2. Challenge: Build a circuit and make one program for the following tasks: a) Build a circuit for two LEDs and one Bi-color LED to be controlled by Propeller BOE at the same time. b) Turn on the first LED for 0.5 seconds, then off. Wait 1 second, and then turn on the second LED for 1.5 seconds and then off. Wait for 1 second. Then blink both LED's on for 1/2 second and off for 1 second. Repeat this for three times before continuing to next step c. c) Turn on both LEDs for 1 second. While these two LEDs are on, display one color for bi-color LED. Turn off both LEDs for 1 second and display different color for bi-color LED at the same time. After repeating this step c three times, continue to step d. d) Repeat parts b and c indefinitely. Blink Two Lights.c #include "simpletools.h" // Include simple tools int main() // Main function while(1) // infinite loop high (14); // Set P14 I/O pin high - ON high(15); pause (200); // Wait 200 ms low(14); // Set P14 I/O pin low - OFF low (15); pause (200); // Wait 200 ms 1. Complete Lab Exercise 2: Lights On - Lights Off. 2. Challenge: Build a circuit and make one program for the following tasks: a) Build a circuit for two LEDs and one Bi-color LED to be controlled by Propeller BOE at the same time. b) Turn on the first LED for 0.5 seconds, then off. Wait 1 second, and then turn on the second LED for 1.5 seconds and then off. Wait for 1 second. Then blink both LED's on for 1/2 second and off for 1 second. Repeat this for three times before continuing to next step c. c) Turn on both LEDs for 1 second. While these two LEDs are on, display one color for bi-color LED. Turn off both LEDs for 1 second and display different color for bi-color LED at the same time. After repeating this step c three times, continue to step d. d) Repeat parts b and c indefinitely. Blink Two Lights.c #include "simpletools.h" // Include simple tools int main() // Main function while(1) // infinite loop high (14); // Set P14 I/O pin high - ON high(15); pause (200); // Wait 200 ms low(14); // Set P14 I/O pin low - OFF low (15); pause (200); // Wait 200 ms

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions