Spike Prime - Tutorial - Teacher Resources
From RoboWiki
Complexity of the task: Easy, students will learn basic controls needed for their future projects.
Lesson Plan
1. Prepare
- Read through the student material.
2. Engage (10 Min.)
- Show a brief video or demonstration of a project that uses BuildHAT to create an interactive application.
- Ask students to brainstorm ways they could use LEGO components combined with Raspberry pi to create their own projects.
3. Explore (30 Min.)
- Guide students through the installation and basic setup of the BuildHAT library on a Raspberry Pi.
- Allow students to investigate and get hands-on experience with the BuildHAT library.
- Have students write simple programs to control LEGO motors and read sensor data.
4. Explain (10 Min.)
- Provide a deeper understanding of the concepts and how to integrate BuildHAT with Pygame or using camera for real time decision making.
- Explain the basics of Pygame, including how to create windows, handle events, and render graphics.
- Demonstrate how to integrate BuildHAT with Pygame by creating a simple application that uses sensor data to control on-screen graphics.
5. Elaborate (30 Min.)
- Extend students' learning by applying their knowledge to more complex projects.
- Assign students to create an interactive application that combines BuildHAT and Pygame. For example, they could create a game where a motor or sensor input affects the game state or display (But keep it simple for now).
- Introduce the concept of using a camera feed. Have students capture live video using the camera setup code provided and display it in a separate window using OpenCV.
6. Evaluate
- Have students present their projects to the class, explaining how they integrated BuildHAT and Pygame and any challenges they faced.
- Ask students to write a short reflection on what they learned, how they overcame any difficulties, and how they might use these skills in future projects.
Ignite a Discussion
Start by watching the video
- What are some creative ways you could use live camera data in a game or application?
- How does using the Raspberry Pi with the BuildHAT library differ from using the LEGO SPIKE Prime in terms of capabilities and flexibility?
- How can the vast range of available Python libraries enhance your LEGO projects when using a Raspberry Pi?
Task for students
Ask students to play with the buildhat library and try to understand how it works and get them thinking what differences there are compared to using Lego Spike Prime by itself.