1/21
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Motor
spins continuously at power value
Servo
rotates between 0 and 100 degrees
digital sensor examples
Bumber switch and limit switch
Analog Sensor examples
potentiometer
Analog and Digital sensor examples
optical sensor and distance sensor
Potentiometer
-analog sensor
-rotates 0-265 degrees
-value range with max of 4095
distance sensor
-uses laser to measure distance of object in front
-detects an object and determine the relative size
-calculate a robot’s approach speed
range is 20mm-20,000mm
Brain
-21 smart ports
-8 3-wire ports
-stores 8 programs
Smart ports
-auto recognition of any v5 sensor
-auto recognition of any v5 motor
3-wire ports
-analog input: brain displays analog value
-digital input: brain displays digital value
-Digital out high” brain makes a “high” (1) signal to send to device
-digital out low: brain makes a “low” (0) signal to send to device
Digital sensor definition
specific, separate values usually represented as binary 0’s and 1’s
analog sensor
continuous and can take value within a range
“while” loop
allows section of code to repeat as long as condition is true
part of a “while” loop:
-”while”
-condition
-commands to repeat
Condition
controls how long/how many times “while” loop repeats
-condition is checked once every time loop repeats
commands
repeat while condition is true
Boolean logic
program decision based on questions
only two possible answers:
-yes/no
-true/false
Boolean statement
statement that can only be true or false
truth value
truth-or-false value
“if” statement
evaluated by condition in parentheses
-if condition is true, commands between braces run
-if condition is false, commands are ignored
-like “while” loop, but code won’t repeat
“if-else” statement
expansion on “if” statement
-”if” checks condition, runs appropriate command if true
-"else” allows code to run when condition is false
-”if” or “else” branch is always run once
Multiple “if-else” statements are dangerous because:
you may create a scenario where two statements “fight” one another