The Art of LEGO MINDSTORMS EV3 Programming (Full Color)
Format: PDF / Kindle (mobi) / ePub
With its colorful, block-based interface, The LEGO® MINDSTORMS® EV3 programming language is designed to allow anyone to program intelligent robots, but its powerful features can be intimidating at first. The Art of LEGO MINDSTORMS EV3 Programming is a full-color, beginner-friendly guide designed to bridge that gap.
Inside, you'll discover how to combine core EV3 elements like blocks, data wires, files, and variables to create sophisticated programs. You'll also learn good programming practices, memory management, and helpful debugging strategies—general skills that will be relevant to programming in any language.
All of the book's programs work with one general-purpose test robot that you'll build early on. As you follow along, you'll program your robot to:
- React to different environments and respond to commands
- Follow a wall to navigate a maze
- Display drawings that you input with dials, sensors, and data wires on the EV3 screen
- Play a Simon Says-style game that uses arrays to save your high score
- Follow a line using a PID-type controller like the ones in real industrial systems
The Art of LEGO MINDSTORMS EV3 Programming covers both the Home and Education Editions of the EV3 set, making it perfect for kids, parents, and teachers alike. Whether your robotics lab is the living room or the classroom, this is the complete guide to EV3 programming that you've been waiting for.
Requirements: One LEGO MINDSTORMS EV3 Home OR Education set (#31313 OR #45544)
uses is likely to make the robot spin. The situation is actually worse when the distance increases beyond 12 cm because the sensor reading starts to increase. This makes the program behave as if the robot is approaching the edge, when it’s actually getting farther away. Figure 19-7 shows how the robot can find itself in this area. The program can overcompensate when the line turns to the right (Figure 19-7a) or not adjust enough when the line turns to the left (Figure 19-7b). Large oscillations
creating an array Write At Index mode, read at index mode ArrayTest program, read at index mode art, and engineering, the LEGO MINDSTORMS EV3 set assumptions, in program design, program requirements automatic routing of date wires, tips for using data wires Auto–ID, brake at end, the touch sensor B Back button, the EV3 lights, buttons, and display back–up copies, of programs, saving your work beeping, while backing up, the motor rotation sensor binning, passing data out of a switch
once, you can use a small Power level in the Medium Motor block to make the arm move very smoothly. Move the arm back to the horizontal position and try a move with a low Power value. Change the Power to -10 and the Rotations to 0.75. The program should now look like this: Run the program and you should see the Lift Arm move smoothly from a horizontal to a vertical position. the invert motor block The Lift Arm moves down when a positive Power level is used because of the way the four-tooth
degrees. With the Move Steering block’s Power item set at 30, the turn is pretty accurate — usually to within 1 degree. Now try increasing the Power parameter to 50, 70, and 90. As the robot moves faster, the accuracy worsens and the robot often goes too far. This happens because there’s a small delay between when the program recognizes that the sensor has met the threshold and when the motors are stopped. When the motors are moving fast, the TriBot can go several degrees beyond the target before
wall. The Infrared Sensor will reach the opening before the back half of the robot, so the robot needs to move forward a little more before turning. After the TriBot has spun a quarter-turn toward the opening, the robot needs to move forward a little more before the Infrared Sensor will be next to the wall. Figure 7-17 shows how the TriBot should move, and Example 7-4 shows the pseudocode for this section of the program. Figure 7-17. Turning and moving through the opening