Question

Upon power up, LEDI flashes 10 times and then turns off. Use either a FOR or a WHILE loop. (5 points) 4. Power 013 D12 Arduin
0 0
Add a comment Improve this question Transcribed image text
Answer #1


// led is connected to pin 13 of the arduino digital pin
int ledpin =13;

// the setup function runs once when you press reset or power the board
void setup()
{
// initialize led connected at pin 13 as an output.
pinMode(ledpin, OUTPUT);
}

// the loop function runs over and over again forever
void loop()
{
// if you want to flash led fast or slow change the value in the delay statement
// low value means fast blinking
// high value means slow blinking
  
for(int i=0;i<10,i++) // after it runs 10 times the condition fails and the led stops blinking
{
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for 200 ms
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(200); // wait for 200 ms
}
}

Add a comment
Know the answer?
Add Answer to:
Upon power up, LEDI flashes 10 times and then turns off. Use either a FOR or a WHILE loop. (5 poi...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • With the use of python IDLE version 3.7.2, use the while loop that iterates 100,000 times....

    With the use of python IDLE version 3.7.2, use the while loop that iterates 100,000 times. In the loop code, roll a pair of dice by generating(and summing) two random numbers in the range 1 through 6. Report to the user how many data points have been generated (i.e how many times the dice have been rolled), as in: successfully simulated 100,000 dice rolls. Create a histogram of the dice rolls showing how many times a 2 was rolled, how...

  • Develop a PLC ladder logic for motor lockout to prevent a machine operator from starting a motor that has tripped off more than 5 times in an hour. The sequence of operation is given below. Please us...

    Develop a PLC ladder logic for motor lockout to prevent a machine operator from starting a motor that has tripped off more than 5 times in an hour. The sequence of operation is given below. Please use the same names (or addresses) for input/outputs as given below. Assume the PLC tick time is 10ms 18j List of Inputs and Outputs: Sequence of Operations: Inputs: 00: Start (Momentary push button) The normally open overload (OL)-retay 01 : Stop (Momentary push button)...

  • Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C -...

    Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C - A consecutive group of memory chunks. D - None of the choices. Question 2 How many times is the body of the loop executed? int i=1; while(true) { cout << i; if(++i==5) break; } A - Forever B - 4 C - 5 D - 6 E - 0 Question 3 What is wrong with the following piece of...

  • CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a...

    CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a gleaming office tower in Houston, Texas. In front of that gleaming tower was a giant "E" slowly revolving, flashing in the hot Texas sun. But in 2001, the Enron Corporation, which once ranked among the top Fortune 500 companies, would collapse under a mountain of debt that had been concealed through a complex scheme of off-balance-sheet partnerships. Forced to declare bankruptcy, the energy firm...

  • summatize the following info and break them into differeng key points. write them in yojr own...

    summatize the following info and break them into differeng key points. write them in yojr own words   apartus 6.1 Introduction—The design of a successful hot box appa- ratus is influenced by many factors. Before beginning the design of an apparatus meeting this standard, the designer shall review the discussion on the limitations and accuracy, Section 13, discussions of the energy flows in a hot box, Annex A2, the metering box wall loss flow, Annex A3, and flanking loss, Annex...

  • All of the following questions are in relation to the following journal article which is available...

    All of the following questions are in relation to the following journal article which is available on Moodle: Parr CL, Magnus MC, Karlstad O, Holvik K, Lund-Blix NA, Jaugen M, et al. Vitamin A and D intake in pregnancy, infant supplementation and asthma development: the Norwegian Mother and Child Cohort. Am J Clin Nutr 2018:107:789-798 QUESTIONS: 1. State one hypothesis the author's proposed in the manuscript. 2. There is previous research that shows that adequate Vitamin A intake is required...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT