LEARN.PARALLAX.COM
Published on LEARN.PARALLAX.COM (https://learn.parallax.com)
Home > Getting Started with BlocklyProp (Legacy Version)

Getting Started with BlocklyProp (Legacy Version)

THIS IS A LEGACY VERSION. PLEASE GO TO GETTING STARTED WITH BLOCKLYPROP SOLO INSTEAD.

The original BlocklyProp system is being replaced by BlocklyProp Solo, which requires no login. You will need to replace your Client utility with an updated Launcher.

Need HELP??? If you get stuck, contact Parallax Tech Support: email support@parallax.com. The BlocklyProp Solo Launcher & FAQ for Schools may also be of help.

What it’s about

The Propeller microcontroller is the tiny computer chip brain on the Activity Board, Propeller FLiP module, and Hackable Electronic Badge.  It can be programmed to make decisions, turn things on and off, read sensors, and do calculations. It is what makes your inventions come to life.

BlocklyProp is a fun, graphical way to build those Propeller programs, piece by piece, using blocks. It is an adaptation of Google’s open-source Blockly tool.

If you have some experience with programming, robotics, or Blockly, that’s great! But if you don’t, do not worry, it is not required here.  Either way, it’s best to go through this introduction before moving on to other BlocklyProp tutorials or projects.

What you need to get started

  • A Windows, Mac, or Chromebook computer with a USB 2.0 port
  • A browser – Chrome is best, and Firefox works too.  (Explorer and Edge are not supported).
  • A Propeller development board plugged into your computer with its USB cable
    • Activity Board
    • ActivityBot Robot
    • Propeller FLiP module on a breadboard
    • Hackable Electronic Badge
    • Propeller Project Board USB
  • Follow the Getting Registered link below to get started!

Have a Scribbler S3 Robot? Start here instead.

Getting Registered

THIS IS A LEGACY VERSION. PLEASE GO TO GETTING STARTED WITH BLOCKLYPROP SOLO INSTEAD.

The original BlocklyProp system has been eing replaced by BlocklyProp Solo, which requires no login. You will need to replace your Client utility with an updated Launcher.

Need HELP??? If you get stuck, contact Parallax Tech Support: email support@parallax.com. The BlocklyProp Solo Launcher & FAQ for Schools may also be of help.

Register on the BlocklyProp Site

Registration is free and allows you to save your projects. Once you have registered, you will log in each time you return to continue saved projects or create new ones.

  • Open another browser window, or tab, and go to http://blockly.parallax.com.
  • Click Login/Register (upper right).
  • Click Register a new account.
  • Enter a Screen name.
  • Enter an Email address.
  • Enter a Password at least 8 characters long, and then again to Confirm password. Allowable characters are A-Z, a-z, 0-9, and !”#$%&’()*+,-./:;<=>?@[]^_`{|}~ (ASCII 32-126)
  • Indicate your Birth Year and Birth Month from the drop-down menus. 
    • If you are under the age of 13, you will need to supply the email address of your Parent (or Teacher), and then Select one option from the drop-down menu indicating Parent/Guardian or Teacher/Instructor.
  • Click on the Register button at the bottom of the form.

Once you have entered all of the necessary information, you should see this message:

  • Check your email for a confirmation message. Follow its instructions to complete your registration.
    • If you are under the age of 13, the confirmation message will go to the email for your Parent/Guardian or Teacher/Instructor, who will need to complete the registration for you.

NOTE: If you are a teacher and your students are using a school email address, please ask your IT Department to white-list the plxmail.com domain. The accounts are confirmed and activated through the email provided at registration. See the BlocklyProp FAQ for Schools for more tips and details.

BlocklyProp-client Download

The next thing you will need to do is install the BlocklyProp-client.

  • After logging in to your BlocklyProp account, scroll to the bottom of the homepage.
  • Click on the BlocklyProp-client link.

A page will open with download links for your detected operating system. You can also click “Show options for all operating systems” to view more choices.

  • Download and install the correct client option for your operating system.
  • Be sure to allow your computer to install the FTD USB drivers as well.

The FTDI USB drivers are required to download code to your Propeller board. You may need to restart your computer for the USB drivers to work.

  • Once you have installed the BlocklyProp-client on your computer, a desktop icon will appear. 
  • Double-click the BlocklyProp icon and press the Connect button.
  • Once the BlocklyProp-client says it has successfully connected to the server, you can then minimize the BlocklyProp-client window (do not exit).

Congratulations!  You are now ready to return to the BlocklyProp homepage. Time to connect your hardware and try some programming!

Next Time You Visit

  • Click the BlocklyProp icon on your desktop.
  • In the BlocklyProp-Client (or BlocklyProp Launcher for Chrome) click the Connect button.
  • For Windows or Mac, click the Open Browser button to open the home page at  http://blockly.parallax.com. 
  • For Chromebook, the browser will launch and open the BlocklyProp home page automatically.
  • Login using your email and password.

You will now be ready to learn and program with BlocklyProp!

 

Create a Program

THIS IS A LEGACY VERSION. PLEASE GO TO GETTING STARTED WITH BLOCKLYPROP SOLO INSTEAD.

The original BlocklyProp system is being replaced by BlocklyProp Solo, which requires no login. You will need to replace your Client utility with an updated Launcher.

Need HELP??? If you get stuck, contact Parallax Tech Support: email support@parallax.com. The BlocklyProp Solo Launcher & FAQ for Schools may also be of help.

If you are here, you should have registered for a BlocklyProp account and installed the BlocklyProp Client. If not,  please go back to the previous page.

  • On your desktop, click the BlocklyProp icon.  When the BlocklyProp-Client or Launcher opens, click Connect.
  • For Windows or Mac, click Open Browser, and then minimize the window (do not close it).
  • A browser window should open the BlocklyProp homepage. Log in to your BlocklyProp account.
  • Connect your Propeller board to your computer’s USB port with its programming cable.  Below are the Propeller FLiP module on a breadboard (left) and Propeller Activity Board WX (right).

 

  • Make sure to connect the Propeller board to your computer.  Both the Propeller Activity Board and the Propeller FLiP module are powered through the USB connection. If you are using an Activity Board, you will also need to move the power switch to position 1:

  • Then, return to the BlocklyProp homepage to start programming.

Creating a New Program

In BlocklyProp, programs are often referred to as projects.

  • In the toolbar, click New project, and this window will open:

  • Type in a Project name (required) and a Description of your project (optional, but a good practice).
  • Click on the Board/Device type drop-down menu, and then select the name of your Propeller development board. (Once you’ve finished making a new project, the board type can’t be changed.)
  • If you are over the age of 13, you will have the option to choose a Community Projects setting. (You can change this option later.)
    • Unlisted: the project won’t be shown on the Community Projects list, but will appear in your “My Projects” list  when you are logged into your BlocklyProp account.
    • Public: the project can be seen and cloned by anyone by clicking on Community Projects.
  • When you’ve made your selection, click Finish.

The BlocklyProp Workspace

The BlocklyProp workspace starts out blank. To the left of the workspace is a category menu of BlocklyProp blocks (note that these are updated periodically). Clicking items with an arrow will open a sub-category menu.

  • Click on a few block menu and sub-menu items. Each time, the sidebar will expand to reveal the blocks available in that category.

To build a program, you will click, drag, and drop these blocks into your workspace in the order they need to run.  Blocks placed near each other that are meant to fit together will snap into place with an audible click. You can click, drag, and drop to separate them again if needed. Many blocks have entry fields and drop-down menus you will use to choose how the blocks behave. Some blocks are designed to fit inside other blocks and work together.


Did you Know?

Special formatting is applied to some words to make our Learn site’s BlocklyProp tutorials easier to read:

  • Words in BOLD CAPITALS are names of block categories, such as COMMUNICATE > TERMINAL.
  • Words in bold lowercase are names of blocks, or parts of a block you need to interact with, such as the Terminal print text block.
  • Words in italics are equations, parts of equations, or hints. For example, d = rt is an equation meaning distance = rate multiplied by time.

Try This – Hello, World! Program

  • Click on the left-side COMMUNICATE category, then on the TERMINAL subcategory
  • Choose the terminal print text block and drop it in the workspace.
  • Place your cursor on the blue block inside the terminal print text block and type “Hello, World!” Your block should look like this:

  • SAVE YOUR PROGRAM! Click the blue Save button on the right end of the toolbar. It should briefly flash green with a checkmark to indicate your program has been saved. BlocklyProp does NOT automatically save your blocks in the background while you work. So, SAVE EARLY, SAVE OFTEN! If you have not saved your program for 20 minutes, a pop-up message may remind you.

The BlocklyProp Client is needed to download programs to the Propeller microcontroller. If it is not connected, you will see the message “Looking for BlocklyProp Client” or “BlocklyProp Client is not running” in the toolbar above the round buttons. If all is well, you will instead see the message “Select the correct port, then click….”

  • Make sure you have the BlocklyProp Client running.
  • From the first drop-down menu in the toolbar, select the COM port connected to your Propeller board.

You have some choices for running your program.

  • Hold your cursor over each round button, left to right, to read the hints on what they do.
    •  Verify code (compile): The checkmark button builds your code and checks it for errors, but does not load it to your Propeller board. A Compile message window will pop up, and if it ends with “Compile successful” then you can continue. If not, read the messages for clues to where you may have an error in your code. Close the box when you are done.
    • Run Once (load code to RAM): The green arrow loads the program to the Propeller chip’s RAM—Random Access Memory. It is volatile memory, meaning it will be erased if power gets disconnected or the Propeller is reset. If you are keeping your project connected to the computer, especially while writing and testing your programs, then this button is fine. If you want to be able to unplug your project from the USB port, use the next option.
    • Load and Run (save code to EEPROM): The green underlined arrow loads the program to EEPROM—Electrically Erasable Programmable Read-Only Memory. The EEPROM memory chip on the Activity Board WX is non-volatile, so programs will remain in your board’s memory even after it has been turned off or reset. Use this option when you are sure your program is complete and ready to use away from the computer.
    • Open Serial Terminal: The first blue button opens an on-screen window that can display messages from, and send characters to, the Propeller board. If you have a Terminal block in your code, then the terminal will automatically open when you run it, so this button is needed only in certain applications.
  • Click the Run Once button. 

After a download progress message, the Terminal should appear and print your “Hello World!” message.  

If the Terminal does not open, and you see a message like the one below, it means that BlocklyProp cannot find your Propeller board:

Try these fixes:

  • Make sure your USB cable is plugged into both your board and your computer securely at both ends.
  • If you are using the Propeller Activity Board, make sure the power switch is in Position 1 or 2.
  • Make sure you have selected the right COM port for your board. 

Your Turn

  • SAVE A COPY! It is always a good habit to click Save before making changes to your code. Click the drop-down menu next to the Save button, and choose Save Project As. Enter a new name and click Confirm.
  • Add to your program above by adding a personal message, like this:
  • You should get a message like this (it’s good, but not perfect):
  • Can you modify the program you’ve just written to add a space between the “!” and the next message that begins with “This”?
  • Can you figure out a way to place the Hello World! message and your personal message on separate lines in the Terminal? (Hint: Take a look at the other TERMINAL blocks and at the checkbox on the terminal print text block).

More BlocklyProp Features

THIS IS A LEGACY VERSION. PLEASE GO TO GETTING STARTED WITH BLOCKLYPROP SOLO INSTEAD.

The original BlocklyProp system is being replaced by BlocklyProp Solo, which requires no login. You will need to replace your Client utility with an updated Launcher.

Need HELP??? If you get stuck, contact Parallax Tech Support: email support@parallax.com. The BlocklyProp Solo Launcher & FAQ for Schools may also be of help.

After completing the previous page, you should know how to write, save, and load a simple “Hello World!” program to your Propeller board’s RAM or EEPROM using BlocklyProp. You also learned to save a copy of a program with a new name. What’s next? The best way to learn is by experimenting with new blocks in other tutorials. But before you go, let’s explore a few more features of the BlocklyProp environment.

Finding Block Information

Some blocks are relatively straightforward to use. Others might need a bit of explanation to figure out what they are for, and how to use them.

]

Try finding the Help information for your Hello World program block.

  • In your Hello World program, hover your cursor over the Terminal print text block for a moment.  A tooltip will appear. Each tooltip includes the block name and a brief phrase about its function.

  • Now, right-click on the block, and choose Help from the bottom of the drop-down menu.

The Help option will take you directly to the page inside the Block Reference which provides details for that specific block, including an explanation for each of the block’s fields. Pay attention to any Info or Warning boxes you come across – it will save you trouble later! (Note: You can also navigate to the Activity Board WX Block Reference under Support > Reference.)

Additional Right-Click Options

Let’s explore the additional block options available from the right-click drop-down menu. 

  • Click Duplicate. It makes a copy of the block your cursor is on, and any other blocks inside of it.  In this example, the Hello World! message is actually in a VALUES > text string block that is pre-inserted into the Terminal print text block by default. You will get a copy of both!

  • Click External Inputs. It changes the visual layout of the block. The text string block is an input to the Terminal print text block and appears inside it in the default internal layout. In the external view, all inputs connect to the right edge of their enclosing blocks.  Right-click it again and choose Inline Inputs to change it back to the original layout.

  • Click Collapse Block. This option visually condenses a block or group of nested blocks, so only the outer enclosing block is visible. Collapsing blocks can be useful for long programs, as you can expand one section to work on at a time but still see the overall code structure. Right click again and click Expand Block.

  • Click Disable Block. This option makes the block or block group inactive and “grays” it out to let you know it has been disabled. You can leave it in place, but the program will no longer execute this block until it is re-enabled, which is very handy for testing ideas and code-bug hunting.

  • Click Delete Block(s). That threw the blocks in the trash. Don’t worry! Just right-click the trash can at the bottom of the workspace, and choose Undo. (CTRL+Z  or Command+Z keyboard shortcuts work as well.) You can also drag blocks into the trash can icon if you prefer. 

When you right-click in the workspace, there is a Delete … Blocks option in the drop-down menu that comes up. This selection will delete ALL the blocks in the workspace!  A pop-up menu asks you to confirm this is what you want before the delete. If necessary, right-click in the workspace a second time to select Undo.

More About Project Files

If you have been following this tutorial from the beginning, you should have two Blockly programs, the second one made with the Save Project As option from the toolbar’s drop-down menu. Let’s look at some other options in this same menu. Most of them cause you to navigate away from your workspace. You will see a pop-up asking if you want to do that, reminding you to click Stay and save your changes first.

Basics

  • Edit Project details let you go back and edit your project’s name and description. You cannot change board type, however.
  • New project starts a new project and lets you create the name and description, as well as choose a board type.
  • My projects takes you to a list of the username you have created yourself, Shared or Private. The convenient table view displays the title, board type, and also the description if you added one.
  • Community projects lists your personal projects, plus all of the projects other users have chosen to make Shared instead of Private.
  • Help & Reference takes you to a page with links to resources on the Parallax Learn site, like this one.

Seeing the C Code

  • Download SimpleIDE files saves the C code that gets generated by your blocks. It is the C code that gets compiled and downloaded to the Propeller microcontroller. You can view the C code for your program by clicking the Code button next to the Save button. If you download this C file, you can open it again in SimpleIDE, a text-based programming tool that does not require Internet access to use once it is installed.

Local Files, for the Adventurous

  • Download blocks file lets you save your Blockly project on your local computer as an SVG file.
  • Upload blocks file lets you re-upload a blocks file you downloaded previously. You will have the option to replace the project you are in with the uploaded blocks or append those blocks to the current project.
  • Here is the .svg file for Hello World, opened in Chrome:

The SVG file stamps your project with your username, the project’s title, its Project ID (also used in the SVG file name) and the Propeller board that is the project’s target. From the SVG file, you won’t be able to edit the project or program your Propeller with it. But it does have two useful purposes for advanced users:

User libraries: BlocklyProp has a define function block that creates a named wrapper around a custom set of blocks that you would like to re-use frequently.  You might create a group of related functions in a custom “library” project and download the SVG file.  Then, you can later upload and append this “library” to your future projects to access your favorite functions.  Kind of like making your own BlocklyProp Bookmobile, if you will.

Lessons plans and handouts: If you are a teacher, the SVG files give you an option for organizing and archiving your lesson plans and assigning template projects to your students without making them community projects.

Demo if you dare: If you want to participate in the ongoing development of the open-source community project that is BlocklyProp, you may find yourself at demo.blockly.parallax.com.  This site is where new blocks for various Parallax devices and new features are tested and tried before being promoted to blockly.parallax.com.  Note, however, that if you create a project on the demo site, it stays there in the demo universe. If you save your demo projects as SVG files, then you may be able to upload them to the production site if/when their blocks go “live.”

Enough of this! Go program! 

  • Check out the other BlocklyProp tutorials and projects —try starting with SimpleBlocklyProp Programs.

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024


Source URL:https://learn.parallax.com/courses/getting-started-with-blocklyprop-legacy-version/
Links