answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ANTONII [103]
2 years ago
13

Write a program in C that reads a 3-bit desired light pattern from the 3 input switches connected to pins P2.3-P2.5 and displays

the pattern on the 8 LEDs (pins P1.0-P1.7) with some ""light playing"" options based on the input from other 3 switches (pins P2.0-P2.2).
Computers and Technology
1 answer:
laiz [17]2 years ago
8 0

Answer:

Check the explanation

Explanation:

#include<stdio.h>

main()

{ int k=1,p,l,i;

int p2[8],p1[8];

for(i=0;i<8;i++){

p1[i]=0;

p2[i]=0;

}

while(k==1)

{

printf("enter the pin inputs from p2.3-p2.5:");

scanf("%d%d%d",&p2[3],&p2[4],&p2[5]);

 

printf("Press Logic 0 for on and 1 for off on switch port p2.0\n");

scanf("%d",&l);

p1[3]=p2[3];

p1[4]=p2[4];

p1[5]=p2[5];

if(l==0)

{p=1;

for(i=0;i<8;i++)

printf("p1.%d : %d\n",i,p2[i]);

printf("\n press either 1 to continue or 0 to stop :");

scanf("%d",&p);

printf("\n");

while(p==1)

{ printf("enter the pin inputs from p2.3-p2.5:");

scanf("%d%d%d",&p2[3],&p2[4],&p2[5]);

p1[3]=p2[3];

p1[4]=p2[4];

p1[5]=p2[5];

for(i=0;i<8;i++)

printf("p1.%d : %d\n",i,p2[i]);

printf("\n press either 1 to continue or 0 to stop :");

scanf("%d",&p);

printf("\n");

}

}

else

{

printf("After Rotation of pattern :\n");

for(i=0;i<8;i++)

{ if(p2[i]==0)

printf("p1.%d : 1\n",i);

else

printf("p1.%d : 0\n",i);

}

}

printf("press 0 for on and 1 for off on switch port p2.1 :\n");

scanf("%d",&l);

if(l==0)

{ printf("\nLeft Rotation of pattern from read mode :\n");

printf("p1.0 : %d\n",p1[0]);

printf("p1.1 : %d\n",p1[5]);

printf("p1.2 : %d\n",p1[6]);

printf("p1.3 : %d\n",p1[3]);

printf("p1.4 : %d\n",p1[2]);

printf("p1.5 : %d\n",p1[1]);

printf("p1.7 : %d\n",p1[6]);

printf("p1.7 : %d\n",p1[7]);

}

else

{printf("\nRight rotation of pattern from read mode: \n");

printf("p1.0 : %d\n",p1[0]);

printf("p1.1 : %d\n",p1[1]);

printf("p1.2 : %d\n",p1[2]);

printf("p1.3 : %d\n",p1[7]);

printf("p1.4 : %d\n",p1[6]);

printf("p1.5 : %d\n",p1[5]);

printf("p1.7 : %d\n",p1[4]);

printf("p1.7 : %d\n",p1[3]);

}

printf("press 0 for on and 1 for off on switch port p2.2 :\n");

scanf("%d",&l);

if(l==0)

printf("Make Rotation fast\n");

else

printf("Make Rotation slow\n");

printf("Enter 1 to continue or 0 to exit:");

scanf("%d",&k);

printf("\n");

}

}

You might be interested in
When workers demonstrate patience, are able to manage there emotions, and get along with other employees, which skills are being
LenKa [72]
The skill thar is being displayed I thing is being outgoing and loyal
6 0
1 year ago
Read 2 more answers
Provide an example by creating a short story or explanation of an instance where availability would be broken.
noname [10]

Explanation:

Personal Insurance

Confidentiality in the workplace: What you need to know

When you give advice to clients or patients for a living, you'll know that protecting sensitive and personal information is crucial. But are you clear on what counts as a breach of confidence or what to do if one occurs?

From how to protect confidential information, to what breaches of confidence look like for different jobs, here's what you need to know about confidentiality in the workplace.

What is a breach of confidentiality?

In short, a confidentiality breach is the disclosure of information to someone without the consent of the person who owns it. In other words, failing to respect a person's privacy or the confidence in which they gave the information or data to you, by passing it onto someone else.

Why is confidentiality important?

Protecting confidential information is vital. If you're in a position where you have access to or are given this type of data at work, your career relies on your ability to keep patient or client confidentiality. If you don't, you could lose trust and integrity in the eyes of your existing (and potential future) clients, who could terminate your contract and take legal action against you.

Therapist/patient confidentiality

Unsurprisingly, patient confidentiality is highly important for therapists and counsellors. It forms part of the therapeutic frame of appropriate boundaries, which creates a safe space for a good working relationship to form.

Here’re some examples of ways you could unintentionally break patient/therapist confidentiality:

Sharing confidential information about a client with a family member or friend

Talking about confidential information somewhere you can be overheard

Leaving your computer containing confidential information open to others

Continuing to work with a client when there's a conflict of interests (for example, they know one of your family members or friends)

When permission to share information is given but isn't specific, this can create confusion and result in a potential breach (for example, a patient may give permission for their information to be shared with a teacher but not their GP)

7 0
1 year ago
Two devices are connected to the Internet and communicating with one another. A squirrel chews through one of the wires in the n
bearhunter [10]

Answer:

Fault-Tolerance

Explanation:

Fault tolerance refers to the ability of a system (computer, network, cloud cluster, etc.) to continue operating without interruption when one or more of its components fail.

5 0
2 years ago
John downloaded the manual for his TV, called manual-of-tv.pdf, from the manufacturer's website. After he clicked twice on the d
wariber [46]

Jhon must download third party pdf viewer softwares to open the .pdf file.

For example

Adobe Acrobat Reader

Must click thanks and mark brainliest

4 0
2 years ago
Why is project scope management so challenging in IT projects? What suggestions do you have for preventing scope creep in projec
seropon [69]

Answer:

Explanation:

<u>Ways to Avoid Scope Creep</u>

Scope creep is what happens when changes are made to the scope of a project without any control. Changes happen to projects all the time without been notify ontime as a project manager. It is that very rare project that ends up delivering exactly what was asked for on the first day. However, without there being some control over the changes, a project manager has little chance of keeping on top of the work and managing the project effectively.

Generally, scope creep is when new requirements are added after the project has commence. These changes are not properly reviewed. The project team is expected to deliver them with the same resources and in the same time as the original scope.

On the other hand, as a project manager you could end up with a project with lots of approved, considered changes, that never ends because every time you think you have finished a new requirement arrives in your inbox and you have to make more changes.

The following are five ways to keep control of your project.

<em>1-Document the Requirements</em>

<em>2-Set up Change Control Processes</em>

<em>3-Create a Clear Project Schedule</em>

<em>4-Verify the Scope with the Stakeholders</em>

<em>5-Engage the Project Team</em>

6 0
2 years ago
Other questions:
  • In an ethernet network, the signal that is sent to indicate a signal collision is called a ________ signal.
    7·1 answer
  • Which data type stores images and audio visual clips?
    15·1 answer
  • A class car and its subclass bmw each have a method run(), which was written by the developer as part of the class definition. i
    10·1 answer
  • Use a VLOOKUP function in cell I5 to identify and calculate the federal withholding tax. Use the tax rates from the range D21:E2
    15·1 answer
  • De'Von is graduating from college and wants to create a professional development plan in order to prepare for his future. What i
    8·1 answer
  • Fill in the blank; "As well as their traditional role of computing data, computers are also extensively used for..."
    14·1 answer
  • Data is: a. Information endowed with relevance and purpose b. Set of specific objective facts or observations c. Some informatio
    10·1 answer
  • Define a function PyramidVolume with double parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the vo
    7·2 answers
  • Create a generic class Box with a type parameter that simulates drawing an item at random out of a box. This class could be used
    7·1 answer
  • In this problem, we want to compare the computational performance of symmetric and asymmetric algorithms. Assume a fast public-k
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!