Explore and Challenge: The Pi-Stop First Steps

SEE ALSO: Discover: The Pi-Stop: For more information about Pi-Stop and how to use it. Setup: Scratch GPIO: For instructions on how to setup Scratch GPIO with Pi-Stop (which is needed for this guide). We shall take our first steps using Scratch GPIO to control the Pi-Stop's LEDs.

Getting Started The Pi-Stop should be connected to the Raspberry Pi in Location A (LEDs facing outwards), as follows: Location A for Model A+, B+ or Raspberry Pi 2 (purchased after July 2014)

TIP: To find Pi-Stop Location A on the 40 pin GPIO header, ensure you count 7 pins directly up from the bottom (that will leave 7 unconnected pins below the Pi-Stop). Your Pi-Stop should be facing towards the nearest side of the Raspberry Pi and inserted on the row of pins nearest the edge. If you are unsure then please ask!

Location A for Model A or B (purchased before July 2014)

Run Scratch GPIO If you are still in the Raspberry Pi terminal, start the desktop environment using: startx

Open Scratch GPIO from the desktop using the Scratch GPIO icon (we do not need the ScratchGPIO 7 Plus):

Scratch GPIO 7 is the standard version, while Scratch GPIO 7 plus provides additional support for several add-on boards. NOTE: If you are using X-Forwarding, you can run Scratch GPIO with the following commands: sudo cp ~/.Xauthority ~root/ sudo /opt/scratchgpio7/./scratchgpio7.sh

The Scratch Interface When Scratch GPIO starts it will look similar to the following:

This is just the same as the normal Scratch interface - the only difference is the hidden background GPIO handler started at the same time (and the message window). The first thing you will find is a small window with the message "Remote sensor connections enabled" . This indicates that the GPIO handler (the part which is listening for the broadcast commands from Scratch is active and ready. You can press OK to clear this message. WARNING: If for some reason this doesn't show, check you clicked on ScratchGPIO 7 rather than the normal Scratch icon. Otherwise, try rebooting (terminal command sudo reboot ) just in case something you ran previously hasn't released the GPIO for example. Finally, you can try re-installing Scratch GPIO by re-running the install scripts.

Next you will see the standard Scratch interface which is split into three main sections (left to right):

1 - Command Blocks Section This is where you select the various types of blocks you can use to make your scripts from. The blocks are organised into 8 different types depending on their function/use. When you wish to use a block, simply drag and drop them over into the space to the right.

2 - Program Script Area This is where you build your scripts by locking various blocks together. If you double click on a block (group of blocks) it will run immediately, otherwise they will run according to events which are triggered (from key presses, the actions by the sprite/in the canvas or using the green flag icon and block). TIP: Each sprite (the default is our friend Scratch) can contain their own set of scripts (so if you create extra sprites your scripts will only appear in the one you first built them in).

3 - Canvas and Sprites The Canvas area is typically where things happen in the Scratch world. Usually we interact with the sprites (such as Scratchy) or draw things on the Canvas to see the results from our script. However since we are also making things happen in the real world by using the GPIO pins we don't have to use the canvas to see something happen, the results of our script will be produced by the Pi-Stop instead. WORKSHEET: Tick the checkbox marked "I now know the different parts of Scatch" Lets now introduce the blocks we will use in our first example.

The broadcast block The broadcast block, is located in the control section:

You may have already come across the broadcast block previously while setting up Scratch GPIO. This block simply announces a message to anything which is listening.

In this case, pin26on is a message which GPIO Scratch understands, and will cause Pin 26 of the GPIO header to switch on which will light up the Red light of the Pi-Stop. By default Scratch GPIO will start with two broadcast blocks, pin26on and pin26off . If they are not, you can add your own using the following steps: 1. Select the control section in the top-left of the Scratch window. 2. Drag over a broadcast block and click on the text space and add a "new..." message. 3. Type in pin26on for the first, and pin26off for the second.

The wait block Next we will take a wait block, again from the control section.

1. Select the control section in the top-left of the Scratch window. 2. Drag over two wait blocks. 3. Form together the four blocks into the following shape.

You can test the block by clicking on it, you should see the Red LED of the Pi-Stop switch on for 1 second and then go off automatically.

The forever block The final block in this section, is called a forever block, this will cause anything it contains to repeat over and over for...well...forever!

1. Select the control section in the top-left of the Scratch window. 2. Drag over a forever block. 3. Move the group of broadcast and wait into the middle of the forever block, you will find that it clicks into place to make the following block.

When you test it this time, by clicking on it, you will find the flashing LED sequence continues to repeat over and over. WORKSHEET: Tick the checkbox marked "Scratch GPIO with a Flashing RED Light Completed!" Remember to save your completed work by selecting File and Save As... from the menu. Congratulations you have created your first Scratch GPIO program with the Pi-Stop! You are now ready to move onto the next guide: Explore and Challenge Scratch GPIO: Pi-Stop Traffic Sequence.

Explore and Challenge - GitHub

Open Scratch GPIO from the desktop using the Scratch GPIO icon (we do not need the ... This is where you build your scripts by locking various blocks together.

471KB Sizes 2 Downloads 346 Views

Recommend Documents

Explore and Challenge - GitHub
Select the Variables tab and add a new variable by pressing the "Make a variable" button, call it Score and set it to be For all sprites. We will also need to create a list to hold our sequence of lights, we will call it GameList: Press the "Make a l

Explore and Challenge - GitHub
Explore and Challenge Scratch GPIO: Pi-Stop Traffic Sequence - Create your own ... Once you have started the Raspberry Pi desktop, open Scratch using the ...

Explore and Challenge - GitHub
WORKSHEET: Tick the checkbox marked "I've created the Pi-Stop STOP and GO sequences". The Final Program - Changing Lights. At the moment our program ...

DIACC Design Challenge - GitHub
Pain Point 1: If an authorized user loses the original PDF certificate (along with the certificate number and access code) they cannot ... Designing for Opportunity (1 of 3). 4. Challenge .... verified as authentic against the blockchain using the mo

Loan Repayment Challenge - GitHub
necessary manipulations or aggregations, generate visualizations, and reach conclusions or insights. The most important thing to remember is that we are evaluating your thought process and ideas! The more you explain your thinking, in a clear and suc

Challenge to Excellence Charter School students explore the world ...
students explore the world using Android tablets with Google Play for Education. About Challenge to Excellence. Charter School. • Charter school serving 510 ...

Solution for the Search Results Relevance Challenge - GitHub
Jul 17, 2015 - They call such method as semi-supervised learning. ... 2. calculate the pdf/cdf of each median relevance level, 1 is about 7.6%, 1 + 2 is ..... Systems: Proceedings of the 2011 Conference (NIPS '11), pages 2546–2554, 2011.

Explore 18.1.5 ANSWERS.pdf
Download. Connect more apps... Try one of the apps below to open or edit this item. Explore 18.1.5 ANSWERS.pdf. Explore 18.1.5 ANSWERS.pdf. Open. Extract.

Explore Performance Task.pdf
Consumes, produces, and/or transforms data. ○ Raises at least one data storage concern, data privacy concern, or data security concern. You are also required ...

Gold nanoparticles explore cells: Cellular uptake and ...
For tracking nanoparticles, bright field images of live cells were. 209 obtained in ..... Using particle. 343 tracking software as described in Section 2.1, 150 particle aggre-. 344 ...... figure in (D) shows the PC1 loadings plot for single cells (t

014-underwater-school-in-archaeology-in-sanitja-and-explore ...
Page 1. Whoops! There was a problem loading more pages. 014-underwater-school-in-archaeology-in-sanitja-and-explore-underwater-pompeii.pdf.

014-underwater-school-in-archaeology-in-sanitja-and-explore ...
Page 1 of 6. Course 014 ... The aim of this project. is to identify .... 014-underwater-school-in-archaeology-in-sanitja-and-explore-underwater-pompeii.pdf.

EXPLORE NE India - Manipur - E-Pao!
Apr 1, 2010 - Production Manager: Kh. Vupendra Singh ... Advertising Manager: Mohd. ... Education and Research, Imphal (Manipur, India) is to prom.

adidas and iProspect explore an innovative ... - Services
We had to look at things a different way, using different data points; ... on that device type than any other,” said Chris Sinclair, Client Services Director,. iProspect. ... Drive sales to adidas brick and mortar stores. • Assign a value for mob

Clojure and Android - GitHub
Improving the Clojure/Android experience. Closing thoughts. Page 5. Clojure and. Android. Daniel Solano. Gómez. Android and the. Dalvik VM ... Page 10 ...

Categories and Haskell - GitHub
This is often summarized as a side-effect free function. More generally ... The composition g ◦ f is only defined on arrows f and g if the domain of g is equal to the codomain of f. ...... http://files.meetup.com/3866232/foldListProduct.pdf ... Pag

Explore the Admin console - G Suite
G Suite services. Add your billing details, add or remove users, set sharing preferences, manage security settings, and more. The Admin console is only available to administrators. When you sign in to your ... see billing details in your Admin consol

Explore Transformations of Rational Functions.pdf
Page 1 of 3. Explore Transformations of Rational Functions! Go to: https://www.desmos.com/calculator. 1. Graph. a. As x gets larger (approaches infinity) what ...