3.5. SUMMARY 73
digitalWrite(right_turn_signal, HIGH); //turn LED on
delay(500); //delay 500 ms
digitalWrite(left_turn_signal, LOW); //turn LED off
digitalWrite(right_turn_signal, LOW); //turn LED off
analogWrite(left_motor, 0); //turn motor off
analogWrite(right_motor,0); //turn motor off
}
}
//*************************************************************************
Testing the control algorithm: It is recommended that the algorithm be first tested without
the entire robot platform. This may be accomplished by connecting the three IR sensors and LEDS
to the appropriate pins on the Arduino UNO R3 as specified in Figure 3.4. In place of the two
motors and their interface circuits, two LEDs with the required interface circuitry may be used.
The LEDs will illuminate to indicate the motors would be on during different test scenarios. Once
this algorithm is fully tested in this fashion, the Arduino UNO R3 may be mounted to the robot
platform and connected to the motors. Full up testing in the maze may commence. Enjoy!
3.5 SUMMARY
In this chapter, we discussed the design process, related tools, and applied the process to a real world
design. As previously mentioned, this design example will be periodically revisited throughout the
text. It is essential to follow a systematic, disciplined approach to embedded systems design to
successfully develop a prototype that meets established requirements.
3.6 REFERENCES
M. Anderson, Help Wanted: Embedded Engineers Why the United States is losing its edge
in embedded systems, IEEE-USA Todays Engineer, Feb 2008.
Barrett S,Pack D (2006) Microcontrollers Fundamentals for Engineers and Scientists.Morgan
and Claypool Publishers. DOI: 10.2200/S00025ED1V01Y200605DCS001
Barrett S and Pack D (2008) Atmel AVR Microcontroller Primer Programming and Inter-
facing. Morgan and Claypool Publishers. DOI: 10.2200/S00100ED1V01Y200712DCS015
Barrett S (2010) Embedded Systems Design with the Atmel AVR Microcontroller. Morgan
and Claypool Publishers. DOI: 10.2200/S00225ED1V01Y200910DCS025
M. Fowler with K. Scott “UML Distilled - A Brief Guide to the Standard Object Modeling
Language,” 2nd edition. Boston:Addison-Wesley, 2000.
N. Dale and S.C. Lilly Pascal Plus Data Structures,” 4th edition. Englewood Cliffs, NJ: Jones
and Bartlett, 1995.

Get Arduino Microcontroller, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.