1 / 28

Coding with EduBlocks

Learn IT Compute IT. Coding with EduBlocks. Transition from Scratch to Python. About Me. Marty Edwards Runs Learn IT Compute IT Ltd GCSE and A-level Computer Science teacher Ex IT-professional as a designer and programmer Raspberry Pi Certified Educator

levitt
Download Presentation

Coding with EduBlocks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Learn IT Compute IT Coding with EduBlocks Transition from Scratch to Python

  2. About Me • Marty Edwards • Runs Learn IT Compute IT Ltd • GCSE and A-level Computer Science teacher • Ex IT-professional as a designer and programmer • Raspberry Pi Certified Educator • Run CPD, workshops and Coding and Maker Clubs • STEM events • Email: marty.Edwards@learnitcomputeit.com

  3. So…what is EduBlocks? • Edublocks language is based on Google’s “Blockly” language. • It allows us to effectively bridge the gap between a graphical coding language and a text based coding language.

  4. EducBlocks and Raspberry Pi • Built for the Raspberry Pi! • EduBlocks for Raspberry Pi is the original edition of the program. • Allows you to drag and drop blocks of python code using its friendly environment • Build simple and complex projects with the GPIO pins, Minecraft and much more!

  5. Install EduBlocks How do I Install EduBlocks on my Raspberry Pi running Raspbian? • Make sure your Raspberry Pi is setup and connected to the internet. • Open up a Terminal window, this can be done by clicking on this    icon in the top left hand corner of the Pi's screen. • Type this command to intallEduBlocks • curl -sSL get.edublocks.org | bash

  6. EduBlocks Another Block based language to help pupils become programmers but this one has a difference

  7. EduBlocks Libraries

  8. Open EduBlocks • You will either find an icon on the desktop • OR • Raspberry Pi -> Programming -> EduBlocks • It can take a little while to open

  9. Let’s compare Before going any further, lets use some of the main Python commands in EduBlocks Using the Basic library you can create programs By clicking on the Blockly button you can see the Python code this has produced.

  10. Other Examples

  11. Average values The program asks the user to enter a number between 1 and 20. If -1 entered the program stops asking and calculates the average total. It then creates suitable outputs formatted to be informative

  12. Average Value Program

  13. More Complex Coding Ideas This script is an interactive guessing game, which will ask the user to guess a number between 1 and 99. We are using the random module with the randint function to get a random number. The script also contains a while loop, which make the script run until the user guess the right number.

  14. Running the Program

  15. Using Functions

  16. Running the Program

  17. Functions Extension

  18. Creating Minecraft Code Click on Minecraft and then General Select the commands highlighted by a RED box Add them to your programming panel Select basic and scroll down to find import time Select the import time command highlighted by a GREENbox

  19. Programming Setup • From the Basic section find time.sleep(1) • Add this to your program. • Change the value in the brackets to be 2. • Your program should no look like this This will be the first 4 lines for all of our programs for Minecraft

  20. Let’s say hello From Minecraft Commands add the mc.postToChat()command to the previous four lines Add a message inside the brackets e.g.

  21. Posting Coordinates Add the next lines to our code These will get the player coordinates and print them The last line also prints the coordinates in a message on Minecraft. Here we need to use string manipulation from Python

  22. Introduce the For Loop This code uses a FOR loop. This type of loop runs for a fixed number of times. Here we can see the SYNTAX of the Python FOR loop In our FOR loop we add 1 to the y coordinate so that each time we go around the loop y gets bigger. We then place a block at the new x,y,z coordinate and then repeat the steps.

More Related