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-3RC SENSOR!!!!!! Ihave already looked at the Arduino website for the code and manyother codes online, I will know if it from a website. Idon't mean to beharsh, just please don't waste my money. Please do not answer itunless you know how to answer it.

Answer & Explanation Solved by verified expert
3.8 Ratings (577 Votes)
create an object for three QTRxA sensors on analog inputs 0 2 and 6 QTRSensorsAnalog qtraunsigned char 0 2 6 3 create an object for four QTRxRC sensors on digital pins 0 and 9 and on analog inputs 1 and 3 which are being used as digital inputs 15 and 17 in this case QTRSensorsRC qtrrcunsigned char 0 9 15 17 4 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    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