Question: i need an arduino code 6) Create 3 functions which match the following types A) Simple if /else decision statement //Reference> Language> Structure> Control structure

i need an arduino code
 i need an arduino code 6) Create 3 functions which match

6) Create 3 functions which match the following types A) Simple "if /else" decision statement //Reference> Language> Structure> Control structure (Compare value, of the ANALOG pin to some 'int' value "threshold") This function should set the DIGITAL (output) pin to either HIGH or LOW based on the value of your ANALOG input. (Attaching an LED to that pin will allow you to see the current state of the decision criteria) (ex. Set the int value [threshold] to '1000 Analog input is 3.3v-value read in is 1023 which is> 1000 so the value is True) Also: Set (change the value of) the GLOBAL BOOLEAN variable you made in step 1 to TRUE) in the case of a value above the threshold, and (FALSE) in all other cases (else) B) A switch/ case statement//Reference >Language >Structure> Control structure 1) Using one BIT from the DIGITAL (input) pin, and the Boolean you set from the ANALOG pin in function A, create a switch structure with 4 conditional cases: Digital State Boolean State 0 0 0 0 2) Each case should set should set (assign the value of TWO DIGITAL pins HIGH or LOW based on the values of the DIGITAL pin (5) and the bool in function (A) based on the value threshold You should print a unique string to the host computer via the SERIAL console to indicate the case selected by each binary state. C) Build a function that TAKES as an argument, the current ANALOG value and RETURNS the result of TWO sequential [the result of one operation is the input of the second] arithmetic operations. Use the constant student id you declared in (2) as an input to at least one of your operations. You may use the MATH built in functions, but they must be called inside your user defined function. /Reference >Language>Functions>Math

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!