New📚 Introducing our captivating new product - Explore the enchanting world of Novel Search with our latest book collection! 🌟📖 Check it out

Write Sign In
Deedee BookDeedee Book
Write
Sign In
Member-only story

LEGO WeDo Set Program Code: Building Instructions

Jese Leos
·8.5k Followers· Follow
Published in Swam: Building Instruction For The Lego Wedo 2 0 Set + Program Code
4 min read
276 View Claps
22 Respond
Save
Listen
Share

LEGO WeDo is an educational robotics set that allows children to learn about coding, engineering, and physics through hands-on play. The set includes a variety of sensors, motors, and bricks that can be used to build robots that can perform a variety of tasks.

Swam: Building instruction for the Lego Wedo 2 0 set + program code
Swam: Building instruction for the Lego Wedo 2.0 set + program code
by JT Hustlez

4.4 out of 5

Language : English
File size : 7216 KB
Screen Reader : Supported
Print length : 15 pages
Lending : Enabled

The LEGO WeDo set comes with a number of different building instructions, but you can also create your own programs using the WeDo software. The WeDo software is a drag-and-drop programming environment that makes it easy for children to create programs to control their robots.

In this article, we will provide you with step-by-step building instructions for a simple LEGO WeDo robot. We will also provide you with the program code for this robot so that you can control it with the WeDo software.

Building Instructions

  1. Start by building the base of the robot. The base should be made of a rectangular brick with two wheels attached to the bottom. You can also add a third wheel to the back of the robot for stability.
  2. Next, build the body of the robot. The body can be made of any type of brick that you have available. You can use bricks to create a variety of different shapes and designs.
  3. Once you have built the body of the robot, you need to attach the sensors and motors. The WeDo set comes with a variety of different sensors and motors, so you can choose the ones that are best suited for your robot.
  4. Finally, you need to connect the WeDo hub to the robot. The WeDo hub is the brain of the robot, and it controls all of the sensors and motors.

Once you have built your robot, you can use the WeDo software to create programs to control it. The WeDo software is a drag-and-drop programming environment that makes it easy for children to create programs. You can use the WeDo software to create programs that make your robot move, turn, and perform other tasks.

Program Code

from weDoLib import * # Create a new WeDo project. project = WeDoProject() # Add a new motor to the project. motor = project.addMotor(1) # Add a new sensor to the project. sensor = project.addSensor(2) # Create a new program for the project. program = project.addProgram(1) # Add a new event to the program. event = program.addEvent(1) # Set the event to trigger when the sensor is pressed. event.setTrigger(sensor.pressed) # Add a new action to the program. action = program.addAction(1) # Set the action to turn the motor on. action.setMotor(motor) action.setSpeed(50) action.setTime(1000) # Compile the program. project.compile() # Run the program. project.run()

This program code will make your robot move forward when the sensor is pressed. You can modify the program code to make your robot perform other tasks, such as turning left, turning right, or moving backward.

Video Tutorial

In addition to the written instructions provided above, we have also created a video tutorial that shows you how to build and program a simple LEGO WeDo robot. The video tutorial is available on YouTube at the following link:

LEGO WeDo Robot Building and Programming Tutorial

We hope that this article has been helpful. If you have any questions about building or programming LEGO WeDo robots, please feel free to leave a comment below.

Swam: Building instruction for the Lego Wedo 2 0 set + program code
Swam: Building instruction for the Lego Wedo 2.0 set + program code
by JT Hustlez

4.4 out of 5

Language : English
File size : 7216 KB
Screen Reader : Supported
Print length : 15 pages
Lending : Enabled
Create an account to read the full story.
The author made this story available to Deedee Book members only.
If you’re new to Deedee Book, create a new account to read this story on us.
Already have an account? Sign in
276 View Claps
22 Respond
Save
Listen
Share

Light bulbAdvertise smarter! Our strategic ad space ensures maximum exposure. Reserve your spot today!

Good Author
  • Corey Hayes profile picture
    Corey Hayes
    Follow ·15.4k
  • Rod Ward profile picture
    Rod Ward
    Follow ·12.8k
  • Isaiah Price profile picture
    Isaiah Price
    Follow ·14.4k
  • Elmer Powell profile picture
    Elmer Powell
    Follow ·18.4k
  • Dan Bell profile picture
    Dan Bell
    Follow ·7.5k
  • Juan Rulfo profile picture
    Juan Rulfo
    Follow ·10.9k
  • Bob Cooper profile picture
    Bob Cooper
    Follow ·12.6k
  • Fredrick Cox profile picture
    Fredrick Cox
    Follow ·16.8k
Recommended from Deedee Book
Her Turn On Stage: The Role Of Women In Musical Theatre
Gerald Bell profile pictureGerald Bell

Her Turn On Stage: Stepping Into The Spotlight Of...

In the realm of personal growth and...

·4 min read
1.7k View Claps
98 Respond
A Pick 3 Indicator System With A Rule For Play
Edward Bell profile pictureEdward Bell
·5 min read
1.6k View Claps
94 Respond
Homes In The Past (Where We Live)
Richard Wright profile pictureRichard Wright

A Nostalgic Journey Through Homes of Yesteryear:...

The Dawn of Human Habitation: Shelter...

·5 min read
446 View Claps
31 Respond
Blind Joe Death William Bay
Douglas Powell profile pictureDouglas Powell
·4 min read
1.1k View Claps
77 Respond
The Big Of Hair Metal: The Illustrated Oral History Of Heavy Metal?s Debauched Decade
Roberto Bolaño profile pictureRoberto Bolaño
·4 min read
742 View Claps
47 Respond
Curious George Goes To A Chocolate Factory
David Peterson profile pictureDavid Peterson

Curious George Goes to the Chocolate Factory

Curious George is a beloved children's...

·4 min read
1.1k View Claps
100 Respond
The book was found!
Swam: Building instruction for the Lego Wedo 2 0 set + program code
Swam: Building instruction for the Lego Wedo 2.0 set + program code
by JT Hustlez

4.4 out of 5

Language : English
File size : 7216 KB
Screen Reader : Supported
Print length : 15 pages
Lending : Enabled
Sign up for our newsletter and stay up to date!

By subscribing to our newsletter, you'll receive valuable content straight to your inbox, including informative articles, helpful tips, product launches, and exciting promotions.

By subscribing, you agree with our Privacy Policy.


© 2024 Deedee Book™ is a registered trademark. All Rights Reserved.