Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I really need help writing the code for this. Thanks :) Coding: Write accurate, executable code to make the Arduino perform a simple, defined function.

image text in transcribedI really need help writing the code for this. Thanks :)
Coding: Write accurate, executable code to make the Arduino perform a simple, defined function. For this competency assignment, you need to create an Arduino program that takes input from an IR distance sensor and controls an LED (you can use the default LED connected to pin 13 on the Arduino board) as follows: If no object is within range of the sensor, the LED is not lit. If an object is between 20 and 30 cm away from the sensor, the LED is lit. If an object is between 50 cm and 80 an away from the sensor, the LED blinks 5 times per second. You should include the following in your submission (pdf or doc only. Arduino.ino fries are not acceptable). 1. One paragraph and a photo or drawing that shows how the sensor and LED are connected to the Arduino. 2. A flowchart that describes the process executed by the loop() function 3. Your complete Arduino code WITH comments explaining the function of each line. 4 A youtube video link showing your demonstration of the code. Please show the distance measured using a ruler/measuring tape and the LED blinking in the video. (you can make the Video unlisted if you don't want it to be public) In this CT you will be using multiple if statements' to write jour code. An example code snippet on how to implement if statements is given below. Checking for grades B and E corresponding to Competency Points:/*This program turns off an LED when ct points correspond to a B and turns on an LED when CT pants correspond to an E */int ct points, //stores the total ct points scored by the student void setup() {pinMode (13, OUTPUT);//pin 13 where LED is connected is an Output pin} void loop() {if((ctpoints = 13))//check if ct points are between 13 and 14 {digitWrite(13, LOW);//Turn off the LED connected to pin 13} if(ctpoints

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions