0 of 7 questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 7 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
If setup() is a function in the Arduino IDE, what is loop()?
It’s sort of a trick question, so congrats to those who get this on the first try!
Do you have any feedback for us to improve this lesson?
This response will be awarded full points automatically, but it will be reviewed and possibly adjusted after submission.
Assume you want to plug an LED into pin 12 on the HERO Board (See image below) and turn it on. What code choice below would allow you to do that?:
Hint:
Regarding the pinMode() function:
An INPUT can be thought of as something that either a human or the outside world would touch and is data sent into the board. Think Keyboard/Mouse, buttons/sensors. However, an OUTPUT is information sent out by the board. (Think computer/phone screens, music speakers, etc). For example, when you push buttons on a keyboard, the computer will OUTPUT information onto the screen in front of you.
Regarding the digitalWrite() function:
HIGH (In the Arduino IDE) is the same as sending 5V over that pin, supplying it with power. LOW, on the other hand, sends a GROUND (aka GND for short) signal over the pin, removing that power.
Assume you have the following function above setup() in your code:
void doSomething() {
// put code here!
}
What would be an appropriate return statement at the end of the function doSomething()?
Assume you have the following function above setup() in your code:
double doSomething() {
// put code here!
}
What would be an appropriate return statement at the end of the function doSomething()?
For loops (see example below) great for the following:
for(int i = 0; i < 100; i++) {
Serial.println(i); //prints value of i to the serial monitor
}
Look at the for loop example provided. It knows it needs to go through exactly 100 times (where ‘i’ will start at value 0, and after each iteration through the loop add exactly 1 to ‘i’ until it hits the specific limit defined of 100)
While loops (see example below) are great for the following:
while(digitalRead(Button) == 0) {
// wait for some unknown amount of time until the button gets pressed (which would set the value to 1 instead of 0).
}
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.