Write an Arduino Program that detects a reflective surface using the line sensor array of a...

60.1K

Verified Solution

Question

Electrical Engineering

Write an Arduino Program that detects a reflectivesurface using the line sensor array of a QTR-3RC (*Must be specificto this sensor! please this is important*)

Must include a function that when calledreturns..
0 (line to the left of the robot)
1 (line under the robot on the left side)
2 (line under the robot on the right side)
3 (line to the right of the robot)

Output the results to the serial port in 0.5 secondintervals

PLEASE USE CODE SPECIFIC TO QTR-3RCSENSOR!!!!!!

Answer & Explanation Solved by verified expert
3.7 Ratings (718 Votes)
A sample calibration routine would be include create an object for your type of sensor RC or Analog in this example we have three sensors on analog inputs 0 2 aka digital pins 14 16 QTRSensorsRC qtrchar 14 15 16 3 QTRSensorsA qtrchar 0 1 2 3 void setup optional wait for some input from the user such as a button press then start calibration phase and move the sensors over both reflectance extremes they will encounter in your application int i for i 0 i 250 i make the calibration take about 5 seconds qtrcalibrate delay20 optional signal that the calibration phase is now over and wait for further input from the user such as a button press A routine to obtain the sensor values and perform rudimentary line following    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students