Computers and Technology

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 }

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:50, CrusaderLord
Define a class named movie. include private fields for the title, year, and name of the director. include three public functions withprototypes void movie: : settitle(cstring); , voidmovie: : setyear(int); , void movie: : setdirector(string); . includeanother function that displays all the information about a movie. write a main() function that declares a movie object namedmyfavoritemovie. set and display the object's fields. this is what i have but know its wrong since it will notcompile: #include#includeusing namespace std; //class declarationclass movie{private: string movietitle ; string movieyear; string directorname; public: void settitle(string title); void setyear(string year); void setdirector(string director); void displayinfo(); }; //class implementationvoid movie: : settitle(string title){ movietitle = title; cout< < "what is the title of themovie? "< > temp; myfavoritemovie. settitle(temp); cout< < "enter movie year"< > temp; myfavoritemovie. setyear(temp); cout< < "enter director'sname"< > temp; myfavoritemovie. setdirector(temp); //display all the data myfavoritemovie. displayinfo(); system("pause"); return 0; this code is not entirely mine someone on cramster edited my firstcode but then i try manipulating the new code and i still get acompile error message : \documents\visual studio 2008\projects\movie\movie\movie. cpp(46) : error c2679: binary '< < ' : no operator found which takes aright-hand operand of type 'std: : string' (or there is no acceptableconversion)c: \program files (x86)\microsoft visual studio9.0\vc\include\ostream(653): could be'std: : basic_ostream< _elem,_traits> & std: : operator< < > (std: : basic_ostream< _elem,_traits> & ,const char *)w
Answers: 1
image
Computers and Technology, 23.06.2019 21:40, jeovontamarley
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
image
Computers and Technology, 24.06.2019 08:00, ineemorehelp
Arah has entered data about football players from team a and team b in a worksheet. she enters names of players from team a with details about each player in different columns of the worksheet. similarly, she enters details of all the players from team b. which option will her view the data for team a and team b in two separate sections after printing? a. page break view b. freeze pane view c. split screen view d. full screen view e. zoom out view
Answers: 1
image
Computers and Technology, 24.06.2019 22:30, juicyx39
In writing a paper for his english class, gavin quoted an author of the book. what should he include in his paper to credit the source? citation caption header entry
Answers: 1
Do you know the correct 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: