ECE 420 Arduino Functions and Command Structures READ THE INSTRUCTIONS: this is intended to be a demo of some of the skills youve acquired so far working with parts of code from the examples do each step as outlined starting from a new sketch in the Arduino IDE ECE 420 Individual Assignment 1
Arduino Functions and Command Structures
Due: Friday March 8th (11:59PM)
INSTRUCTIONS:
READ THE INSTRUCTIONS: this is intended to be a demo of some of the skills youve acquired so far
working with parts of code from the examples do each step as outlined starting from a new sketch in
the Arduino IDE.
This assignment will be submitted via Canvas:
Please include the requested information as a SINGLE (.DOC) file
Add a complete copy of your code (copy paste) from the Arduino IDE [screen shots will not be
accepted] If you are having trouble with copying from the IDE you can save and open the sketch as an
*.INO and open it using Notepad++ or another text editor. (This file is formatted plain text).
Answers to any questions asked at the end of the exercise.
— Don’t panic! -ASSIGNMENT 1:
Generate a single Arduino code sketch*which accomplishes the tasks listed below:
1) Declare a Global boolean value with a name of your choice (for use in conditional in function A)
2) Declare an integer number* (for use in calculations function C)
*Use the last three numbers of your student id declare the value as a constant
3) Declare FIVE pins, FOUR DIGITAL and ONE ANALOG, use any names you want,
*try using good coding practices like underscores_to_separate_words (typically for variables) or
camelCaseForNames (typically for functions)
A) Select DIGITAL pins from first bank – pins 0 – 12, do not use the built in LED on pin 13.
b) You can select any ANALOG pin from A0-A15.
4) In the SETUP declare the pin modes of the DIGITAL pins one as input, the others as output
5) READ the ANALOG and DIGITAL (input) values at the start of each loop() you need to declare
a variable to store the values in be sure to watch out where you declare those variables to
insure the right access for the scope.
6) Create 3 functions which match the following types:
A) Simple if /else decision statement
(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
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
1
1
0
1
1
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.
Your function should also print the results of the sequential operations to the host
computer via the SERIAL console as a new line.
Purchase answer to see full
attachment
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.