Robotics Reviewereibann0
Robotics Reviewereibann0
Example: fd2(100,30);
©eibamn0
Robotics Reviewer
Shortcut: sl(100); - variable value/sensor value
- spin left
OBJECT
sr(100);
DETECTION
- spin right A. In your c-robot simulator, click
on the ZX SETTING icon
B. Select the sensor port PA8 To
SENSOR enable the distance sensor,
click Apply and OK.
CALIBRATION
C. Calibrate your distance sensor
1. DISPLAYING TEXT AND NUMBERS IN PA8.
THE LCD SCREEN D. Define your variable and
sensor.
lcd(“text”);
E. Create the robot’s initial
Example: movement.
lcd(“REGION 1”); F. Set the condition.
*The c-robot simulator LCD can only *Using if/else statement.
display 36 words or 18 words per row.
If/else statement executes a code
DISPLAYING SENSOR VALUE IN THE LCD if a specified condition is true or false.
SCREEN
“If”
A. In your c-robot simulator, click on
the ZX SETTING icon – condition is TRUE
B. Select the sensor you want to “else”
calibrate.
Example: PA8 – condition is FALSE
C. Create your calibration codes
and run the program. G. Define the action code of the
Sample Calibration code: if/else statement.
int sense = analog(8); F. Compile and run the program.
lcd (“%d”, sense);
*The robot must stop from moving
int once it
- a data type used to define detects the ball.
numeric variables holding whole
number *The command keep_up() is used
a to grab or carry the ball while
- variable name/ user define keep_down() is used to
analog(8) - analog port of the release the ball.
sensor you want to calibrate. (ex.,
PA8)
%d
©eibamn0
Robotics Reviewer
LINE
FOLLOWING WITH
INTERSECTION
Load Map 05
©eibamn0