Setup: Scratch GPIO. What is Scratch? Introducing Scratch GPIO. How to install Scratch GPIO. Obtain Scratch GPIO

Similar documents
Zero2Go. User Manual (revision 1.03) Wide Input Range Power Supply for Your Raspberry Pi. Copyright 2017 UUGear s.r.o. All rights reserved.

Adafruit's Raspberry Pi Lesson 1. Preparing an SD Card for your Raspberry Pi

Raspberry Pi Workshop

GNSS Logger Unit with RTKLIB. Tiphat Areeyapinun Shizuoka University

Quick Reference Tables

Adafruit's Raspberry Pi Lesson 1. Preparing an SD Card for your Raspberry Pi

RETROPIE INSTALLATION GUIDE

Experimental Procedure. Frequently Asked Questions (FAQ) Kit General Questions. Setting Up and Using Your Raspberry Pi Projects Kit

Raspberry Pi NTP Clock Setup Guide

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems

How to Back-Up a fit-pc2 Using Only a USB Stick (and some creative partitioning)

PiRyte Mini ATX PSU Revision 1.0 User Manual

RaspiDigiHamClock. Raspberry Pi Amateur Radio Digital Clock. v WA4EFH R.Grokett

Getting Started Guide XC9010 Raspberry Pi Starter Kit

Raspberry Pi Setup Tutorial

Experiments 1 How to set up Raspberry Pi B+ The little computer you can cook into DIY tech projects

Raspberry Pi 2b PART 1. Table of Contents. Step by step guide. 1. Hardware (0:05) RS Online (ex-tax prices)... 3 MSY ebay...

Linux Manually Mount External Hard Drive Ntfs-3g Could Not

ELI Screen Blanking During Boot

Tizen.IoTivity.Init. Tizen IoTivity 를시작하기위한환경설정. Geunsun Lee

Ubuntu Manual Disk Partitioning Guide

Orange Pi 2 User Manual. <Version: V0.9 >

How to securely isolate Damn Vulnerable Linux with VirtualBox

Wallet Installation Guide for Staking on Raspberry PI

A Beginners Guide to Raspberry Pi

Start Up and Shutdown Procedures (Unix)

PiRyte Mini ATX PSU Revision User Manual

Theo. Miles. Olivia. Joseph. Nina. Kishan. The Richard Pate School, Cheltenham

Linux Manually Mount External Hard Drive Ntfs 3g Could Not

Raspberry Pi Introduction

TROUBLESHOOTING RASPBERRY PI USER GUIDE. Troubleshooting

RaRa Academy: Raspberry Pi. Karl Heinz Kremer - K5KHK

Raspberry Pi Setup. 5 HDMI NightScout Display Notes: Instructions to switch to chromium-browser highlighted in yellow.

CPF Arduino Blockly V

This is Lab Worksheet 7 - not an Assignment

For the ipad: The ipad

This is Lab Worksheet/Installation 7

Raspberry Pi Class Ed 299. Mike Davis Truman College 5/26/2015

BCS Raspberry Pi Launch Events Getting started with Raspberry Pi

SETUP INSTRUCTIONS. Eynio Server Setup Instruction

Vvisto. User Manual. & Installation Guide. USB 2.0 Hard Drive with Multi Card Reader, featuring easy file backup!

Preparing SD card for Pi

UM2375 User manual. Linux driver for the ST25R3911B/ST25R391x high performance NFC frontends. Introduction

PiCloud. Building owncloud on a Raspberry PI

Apex RMS Android PDA Installation / User Guide

CST8207: GNU/Linux Operating Systems I Lab Nine Disks, Partitions, and File Systems Part 2. Disks, Partitions, and File Systems - Part 2 of 2

ELI Screen Blanking During Boot

Convert VHS to Digital or DVD using Roxio Video Capture

Manually Mount External Hard Drive Windows 7 Not Showing In My Computer

DMD Extender. Raspberry Pi Installation Addendum

Disk Imaging with Knoppix

IES-SHIELD-SCX18 Quick Start Guide

JetFlash User s Manual

DATASHEET. 4DPi-24-HAT. 2.4 Primary Display for the Raspberry Pi. In partnership with. Compatible with A+, B+ and Pi2

Interpretype Bluetooth Setup Procedure

SenCom Jan. 11, 2013 Demonstration on Windows 7 Desktop, Windows Explorer & File Mgmt., and using Thumb/Flash Drives These topics by Mike Smith

XLink Kai Raspberry Pi Beginners Tutorial

CompTIA Linux+ Guide to Linux Certification Fourth Edition. Chapter 2 Linux Installation and Usage

3.5 Inch TFT Display

ELI Launcher Configuration

Installation of RedHawk 6.5-r24.2 on the Jetson TX1 Development Board Release Notes. September 19 th, 2017

Section 1. System Technologies and Implications. Modules. Introduction to computers. File management. ICT in perspective. Extended software concepts

Manual to install experimental firmware on a TYTERA MD380

A Slice of Raspberry Pi

Davide Cavaliere 18 th February 2017

Lab2 - Bootloader. Conventions. Department of Computer Science and Information Engineering National Taiwan University

Installing and Configuring the Voice UPB Bridge updated 1-Jan-2019

The Digital Revolution

Smarty Touch User Guide

Using the Android CircuitPython Editor

Rapoo E6700 Setup Instructions

Windows Method Using Linux Live CD and Gparted

Lab 1: Introduction to Linux Networking

Lionstracs Groove X-R

Pi-SPROG One. DCC Decoder Programmer and Command Station for Raspberry Pi. User Guide

Raspberry PI 'How-To' Series

D, E I, J, K. Generalized Regular Expression Parser (GREP), 110 Generic 105 key (Intl) PC, 29 git command, 242

Adafruit's Raspberry Pi Lesson 2. First Time Configuration

Lab E2: bypassing authentication and resetting passwords

RocketRAID 2522 SATA Controller Ubuntu Linux Installation Guide

Manually Mount External Hard Drive Win 7 Not Showing Up

Contents. 1 Drobo 5C Online User Guide Before You Begin Product Features at a Glance Checking Box Contents...

ProMAX Platform Portable Quick Start Guide

Getting started with Raspberry Pi (and WebIoPi framework)

Stealth HD Bio Quick Start Guide

StromPI V2 User manual

How do I setup a Raspberry Pi?

Cross-compilation with Buildroot

Project 3: An Introduction to File Systems. COP 4610 / CGS 5765 Principles of Operating Systems

Setup Instructions for Upgrading the Windows XP Panasonic CF-19 Toughbook to Windows 7

Bluetooth Keyboard Setup Instructions

DUAL OS INSTALLATION

CHAPTER 17 COMPILING/SIMULATING/DOWNLOADING A PANEL APPLICATION

Tutorial : Confguring a micro SD memory card as both swap and storage area for the DragonBoard 410c (DB410C)

Getting Started with Python and the PyCharm IDE

Arduino Micro Breadboard Laboratory Interface Processor (Micro BLIP) User Manual

Please read this manual carefully before you use the unit and save it for future reference.

DATASHEET. 4DPi Primary Display for the Raspberry Pi REVISION 2.0 HARDARE. Document Date: 28 th September 2015 Document Revision: 2.

USER GUIDE. Workshop 4 User Guide. Document Date: 17 th December 2012 Document Revision: 1.1

Lab: Setting up PL-App with a Raspberry Pi

Transcription:

Setup: Scratch GPIO What is Scratch? Scratch is a beginner friendly way to program the Raspberry Pi, designed for those who have not programmed before and are put off by the random keyboard mashing type code normal programming typically produces. Programs are simply created by dragging and dropping various types of blocks together to produce a sequence of instructions to follow. The default character who is tasked with following all these instructions is Scratch the cat! A typical program is shown below: On the surface Scratch is deceptively simple, however do not let that fool you, there is a lot that can be done by putting a few blocks together and because you are not distracted by syntax and confusing commands, you can really focus bring your ideas to life and what you want to achieve. Introducing Scratch GPIO Scratch GPIO was created by Simon Walters (@cymplecy) to allow Scratch to interact with physical hardware. Full details of Scratch GPIO is available on his website: http://cymplecy.wordpress.com/scratchgpio/ How to install Scratch GPIO Obtain Scratch GPIO Scratch GPIO is installed from a single setup file. If an internet connection is available, obtain the Scratch GPIO setup file by running the following command.

sudo wget http://goo.gl/pthh62 O install_scratchgpio5.sh Or download the file directly on another computer and copy it to your Raspberry Pi SD-Card or a USB drive (see the TIPs below for details on how to access it on the Raspberry Pi): http://goo.gl/pthh62 TIP: In the workshop, preconfigured SD-Cards are available which can also be connected to the USB of the Raspberry Pi. They will contain the required setup file. Run the install script Run the script to install Scratch GPIO using the following command: sudo bash install_scratchgpio5.sh It is as simple as that, Scratch GPIO is installed on your system! If you have any problems, see the TIPs below for additional help. Safely shutdown your Raspberry Pi Before we continue, you will need to shutdown and power off the Raspberry Pi so we can fit our hardware onto the GPIO pins. WARNING: It is advisable to only connect and disconnect hardware to the GPIO pins when the Raspberry Pi is switched off to avoid damage. If your Raspberry Pi automatically starts in the desktop, click on the red power button in the bottom right corner and select Shutdown from the menu which comes up. Or open a terminal window (by clicking on the Terminal icon or selecting from the menu). From the terminal type the command sudo shutdown -h now. When the green activity (ACT) LED on the Raspberry Pi has stopped flashing (for over 5 seconds) you can safely disconnect the power. WORKSHEET: Put a big tick in the checkbox marked "I have installed Scratch GPIO!" TIP 1: If you have a different user name to the default pi user, use the following command: sudo bash install_scratchgpio5.sh yourid TIP 2: If you have copied the file to your Raspberry Pi SD-Card you can access it as shown below (depending if you have a NOOBS setup or not). When using NOOBS, only the RECOVERY partition of the SD-Card will be visible on many computers, so you can copy the file there. To access this partition on the Raspberry Pi it will need to be mounted before you can run the script: mkdir ~/recovery sudo mount t vfat /dev/mmcblk0p1 ~/recovery sudo bash ~/recovery/install_scratchgpio5.sh If using a basic imaged system (non-noobs), the file can be run directly from the BOOT partition: sudo bash /dev/boot/install_scratchgpio5.sh

TIP 3: If you have the files on a USB device, you can access the install_scratchgpio5.sh as follows: Insert the USB device or USB SD-Card reader with the Workshop SD-Card inside, into one of the Raspberry Pi's SD-Card. From the terminal, use the following command: sudo fdisk -l This will list all the drives and partitions detected on the system (if it is not detected as sda1 you can adjust the commands as needed). mkdir ~/sdcard sudo mount t vfat /dev/sda1 ~/sdcard sudo bash ~/sdcard/install_scratchgpio5.sh How does it work? The broadcast block In addition to the normal Scratch blocks as shown above, Scratch is able to shout (called broadcast) messages to anything which is listening. The Scratch GPIO Helper Scratch GPIO is a slightly modified version of standard Scratch which has an additional helper (scratch_gpio_handler.py) running in the background. The GPIO helper listens for any broadcast massages which it understands and controls the connected hardware accordingly. Install our hardware First before we plug in our hardware, shut-down the Raspberry Pi if you haven't done so already (see above). The Pi-Stop should be connected to your Raspberry Pi GPIO header P1 using Location A (LEDs facing outwards), as follows:

SEE ALSO: For more information about Pi-Stop and how to use it: Discover: The Pi-Stop WORKSHEET: Put another tick in the checkbox marked "I have powered down the Raspberry Pi and fitted the Pi-Stop in location A" Run Scratch GPIO Plug the power cable back into the Raspberry Pi and let it start up. If you are still in the Raspberry Pi terminal, start the desktop environment using: startx When the desktop has reloaded, you will discover two new icons: Scratch GPIO 5 is the standard version, while Scratch GPIO 5 plus provides additional support for several add-on boards. NOTE: If you are using a remote connection and X-Forwarding, you can run Scratch GPIO with the following commands: sudo cp ~/.Xauthority ~root/ sudo ~/scratchgpio5/./scratchgpio5.sh Performing our first test with Pi-Stop When you switch on your Raspberry Pi you will probably see the Pi-Stop's Red and Yellow LEDs are ON. Once you have started Scratch GPIO and it has enabled the remote sensor connections, you may find that these LEDs have switched OFF or dimmed. Take control The program starts with two default Broadcast blocks, with the messages pin26on and pin26off setup. We can immediately control our Pi-Stop lights by clicking directly on each of the broadcast blocks to switch on or off the Red light of our Pi-Stop.

WORKSHEET: Put a final tick for this section in the checkbox marked "I have tested Scratch GPIO with the Pi- Stop and it works!" NOTE: The Pi-Stop will be available in limited numbers from www.4tronix.com next week. With more to be in stock shortly after. When available they will be sold in pairs, packs of four and classroom/workshop packs: Approximate price will be 5 for two Pi-Stops See www.pihwardware.com for updates. To reserve some or to enquire about classroom/workshop packs: Contact me (Tim Cox) at pihw-orders@hotmail.co.uk