Control Structures

Cards (22)

  • Computer programming
    • One of the functions is for communication between humans and computers or machines
    • Key skill to develop for working in robotics
  • Conditional statement
    Allows performing different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false
  • Conditional control structures
    • Make conditions or expressions that evaluate to either true or false
    • Mostly used to determine program flow through if statements and while loops
  • Control Structures Common Syntax
    • digitalWrite()
    • delay()
  • IF CONDITIONAL STATEMENT
    Executes any statement inside the brackets { } if the conditional statement is true. If false, the program skips over the statement
  • If - Else CONDITIONAL STATEMENT
    An if statement can have an else clause which handles what should be done if the if statement is not true
  • while LOOP STATEMENT
    Continues to repeat a block of code as long as the condition is true
  • for LOOP STATEMENT
    Most useful when you want something to happen a couple of times
  • Robots replaced some people working on dangerous tasks
  • Robots receive commands from programmers to do a certain task using computers and software
  • Robots cannot understand the language humans use
  • Robots replaced some people working on dangerous tasks, making our lives more convenient
  • Robots
    Receive commands from programmers to do a certain task using computers and software
  • Communication between robots and humans is important
  • Programming languages are developed because robots cannot understand the language we use
  • Source codes (commands)

    Converted into machine codes that can only be understood by computers
  • Serial Monitor
    A tool used for communication between the Arduino board and a computer or other devices
  • Serial Monitor
    Allows sending messages from a computer to an Arduino board (over USB) and receiving messages from the Arduino
  • Opening up the Serial Monitor
    After uploading the sketch onto your Arduino, click on the right-most button on the toolbar in the Arduino IDE
  • Serial Monitor Window
    • Acts as a separate terminal that communicates by receiving and sending Serial Data
    • Part of the Arduino IDE software
  • Serial Data is sent over a single wire (but usually travels over USB) and consists of a series of 1’s and 0’s sent over the wire
  • Serial Monitor Window is called the Serial Monitor and it is part of the Arduino IDE software