0% found this document useful (0 votes)
5 views27 pages

Part 2 RGB LED, Motors, & Voice Commands

Uploaded by

pavaziphram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views27 pages

Part 2 RGB LED, Motors, & Voice Commands

Uploaded by

pavaziphram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

PROGRAMMING USING

WEEECODE SOFTWARE

© Copyrighted Material
1
Data Science and Technology Corporation
RGB LED

© Copyrighted Material
2
Data Science and Technology Corporation
RGB LED

RGB stands for Red, Green, and Blue and can be


used to generate different colors by adjusting the
brightness level from 0 to 255.
RGB LED

WeeeCore has 5 RGB LEDs. You can choose whether all


LEDs will display your chosen color or selected LEDs only.
In this sample block, all LEDs will lit up with red color.
GUIDED PRACTICE: RGB LED

Click File and load the sample program - 1. RGB LED

OUTPUT: When BUTTON A is pressed, all the LEDs will


turn RED for 1 second.
INDEPENDENT PRACTICE: LED SEQUENCE
➢ Open the program 1.2 RGB LED Sequence to show the 3
primary colors; Red, Green, and Blue when you press
Button A. Each color will turn on for 1 second.
Basic Motor Commands
– Robot Movements

© Copyrighted Material
7
Data Science and Technology Corporation
DC MOTOR ENCODER

When using the motors, make sure the batteries are full charged

Left motor Right motor

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

Stop – set the speed to zero

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

Counter Clockwise ( curve left)

14
SPIN TURN
B) SPIN TURN - both motors are moving but in opposite directions.

Spin Left (CW)

Spin Right (CCW)

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

Speed must be assigned first before the actual motor commands


20
MOTOR ENCODER COMMANDS
Programming
Voice Commands

© Copyrighted Material
Data Science and Technology Corporation
PROGRAMMING VOICE COMMANDS

Click File and load the sample program - 4 Voice Commands

OUTPUT: Vivi will perform the following commands through voice


recognition: turn on/off lights, and move forward and stop.

To start the uploaded program,


simply say “Hi, Vivi” or “Hi, Bot”.
PROGRAMMING VOICE COMMANDS
PROGRAMMING VOICE COMMANDS
PROGRAMMING VOICE COMMANDS
➢ Create a program were the robot performs different actions
through voice recognition.
END OF THE LESSON

You might also like