subject

Task 1 - Specific task • Set up a circuit with 6 LEDs and either a button or an analog sensor. Write a code (starting with a blank Arduino sketch) that does the following.
• Does not have any digitalWrite functions used in the void setup or void loop.
• Write one function that does not return a value.
• The function will have 3 inputs (controlling 3 LEDs).
• The function will complete the same thing as Homework 1 Task 1.
• In the void loop read the button or sensor.
• Use some type of conditional statement (if, while, switch, etc.) to either have once set of 3 LEDs blink or the other set.
• Only one function should be needed, just change the inputs for different LEDs.
Task 2 - Students choice Write either a non-value returning function or a value returning function to do whatever you want (you may also use more components or any previous syntax). You design not only how to build the circuit and write the code, but also what the code/circuit will do. 1 const byte lede 2; // the red led is connected to digital pin 2
2 const byte ledB = 3; // the blue led is connected to pin 3
3
4 void setup() the setup runs once and first
5 {
6 pinMode(ledr, OUTPUT); pin 2 is setup to be an output
7 pinMode (lede, OUTPUT); pin 3 is setup to be an output on
8 {
9
10 void loop() repeats forever
11 {
12 digitalWrite(ledR, HIGH) : turn on Eed led
13 digitalWrite(ledB, LOM) : turn off blue led
14
15 delay(1000); // wait for 1000 milliseconds
16
17 digitalWrite(ledB HIGH);
18 digitalWrite(lede, LOVE turn on blue led
19
20 Cuen edo delay(1000); // wait toe 1 second
21 }

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:30, jonquil201
Where would you click to edit the chart data?
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, noah2o2o
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
image
Computers and Technology, 23.06.2019 09:30, nsjcbdhcb
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, 19thomasar
How to do this programming flowchart?
Answers: 3
You know the right answer?
Task 1 - Specific task • Set up a circuit with 6 LEDs and either a button or an analog sensor. Wr...

Questions in other subjects: