Download presentation
Presentation is loading. Please wait.
1
using “if” statements
2
DISCLAIMER & USAGE The content of this presentation is for informational purposes only and is intended only for students attending Louisiana Tech University. The author of this information does not make any claims as to the validity or accuracy of the information or methods presented. Any procedures demonstrated here are potentially dangerous and could result in injury or damage. Louisiana Tech University and the State of Louisiana, their officers, employees, agents or volunteers, are not liable or responsible for any injuries, illness, damage or losses which may result from your using the materials or ideas, or from your performing the experiments or procedures depicted in this presentation. If you do not agree, then do not view this content. The copyright label, the Louisiana Tech logo, and the “living with the lab” identifier should not be removed from this presentation. You may modify this work for your own purposes as long as attribution is clearly provided.
3
example add lines of code to your servo program similar to those below to make your robot move forward when nothing is blocking its path if (distanceCM > 30) { forward(); } // go forward when leading robot > 30cm ahead else { stop_robot(); } // stop robot otherwise
4
if statement details comparison operators if (x > 50)
{ // do something here } comparison operators x == y x is equal to y x != y x is not equal to y x < y x is less than y x > y x is greater than y x <= y x is less than or equal to y x >= y x is greater than or equal to y arduino.cc
5
play follow the leader with your robots
attach a target to the back with binder clips
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.