Part 2 RGB LED, Motors, & Voice Commands
Part 2 RGB LED, Motors, & Voice Commands
WEEECODE SOFTWARE
© Copyrighted Material
1
Data Science and Technology Corporation
RGB LED
© Copyrighted Material
2
Data Science and Technology Corporation
RGB LED
© Copyrighted Material
7
Data Science and Technology Corporation
DC MOTOR ENCODER
When using the motors, make sure the batteries are full charged
8
MOTOR COMMANDS
Open the program 2: Basic Movements
Motor speed = 0 to 255; 0=stop; 255 = max speed;
+speed = forward; - speed=backward
9
10
FORWARD AND BACKWARD
Forward
Backward
11
TURNS AND STEERING
© Copyrighted Material
12
Data Science and Technology Corporation
MOTOR COMMANDS
Same program, change the commands to Spin left and
Spin right. Upload and observe
13
CURVE TURNS
A) CURVE TURNS: Both motors are moving in the same direction
but with different speed. One motor is faster than the other.
Clockwise (curve right) brilliant.org
14
SPIN TURN
B) SPIN TURN - both motors are moving but in opposite directions.
15
SWING TURN
C) SWING TURN - only one motor is moving.
Swing Left
Swing Right
16
Motor Encoder
© Copyrighted Material
17
Data Science and Technology Corporation
DC MOTOR VS DC MOTOR WITH ENCODER
An encoder is a sensor / device attached to a motor that provides
information about the motor's position, speed, and direction.
Regular DC Motors DC Motors with Encoder
FORWARD AND BACKWARD
Use motor encoder commands if you want your robot move with
precision regardless if your robot’s battery if full or not
© Copyrighted Material
Data Science and Technology Corporation
PROGRAMMING VOICE COMMANDS