Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. S4A - Scratch for Arduino Workbook

Similar documents
Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. LEGO Bowling Workbook

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Kinect2Scratch Workbook

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Scratch for Beginners Workbook

Objective of the lesson

Getting Started with the micro:bit

Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink

Rodni What will yours be?

Programming 2 Servos. Learn to connect and write code to control two servos.

Creating Computer Games

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

RUNNYMEDE COLLEGE & TECHTALENTS

1hr ACTIVITY GUIDE FOR FAMILIES. Hour of Code

1. ASSEMBLING THE PCB 2. FLASH THE ZIP LEDs 3. BUILDING THE WHEELS

The light sensor, rotation sensor, and motors may all be monitored using the view function on the RCX.

Two Hour Robot. Lets build a Robot.

UNIT 4 VOCABULARY SKILLS WORK FUNCTIONS QUIZ. A detailed explanation about Arduino. What is Arduino? Listening

Arduino STEAM Academy Arduino STEM Academy Art without Engineering is dreaming. Engineering without Art is calculating. - Steven K.

Programming I (mblock)

Lab 2: Blinkie Lab. Objectives. Materials. Theory

Programming a Servo. Servo. Red Wire. Black Wire. White Wire

Step 1 : Earth and Mars Orbit the Sun

UCL Micro:bit Robotics Documentation

In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

Arduino Lesson 1. Blink. Created by Simon Monk

Module 4 Build a Game

Controlling Your Robot

How to Build the Robotics++ V2 Robot. Last Edited Nov

TETRIX PULSE Workshop Guide

Workshops Elisava Introduction to programming and electronics (Scratch & Arduino)

1 Day Robot Building (MC40A + Aluminum Base) for Edubot 2.0

smraza Getting Start Guide Contents Arduino IDE (Integrated Development Environment)... 1 Introduction... 1 Install the Arduino Software (IDE)...

Open the Tech Toys Scratch project. Your club leader will give you a copy of this project, or you can open it online at jumpto.cc/toys-go.

Program.

DIY Speaker Kit. Build a custom set of speakers

Memory. Introduction. Scratch. In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

An Introduction to ScratchJr

Using the SparkFun PicoBoard and Scratch

Downloading a ROBOTC Sample Program

You are going to learn how to create a game in which a helicopter scores points by watering flowers in the city.

Pi-Cars Factory Tool Kit

On the front of the board there are a number of components that are pretty visible right off the bat!

App Inventor meets NXT

Studuino Icon Programming Environment Guide

INSTANT ROBOT SHIELD (AXE408)

GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game

I.1 Smart Machines. Unit Overview:

Lesson 3: Arduino. Goals

Coding with Arduino to operate the prosthetic arm

CONSTRUCTION GUIDE Robotic Arm. Robobox. Level II

Robotics 2a. What Have We Got to Work With?

Ghostbusters. Level. Introduction:

Lost in Space. Introduction. Scratch. You are going to learn how to program your own animation! Activity Checklist.

1 Introduction. 2 Embedded Electronics Primer. 2.1 The Arduino

Your EdVenture into Robotics 10 Lesson plans

Game Making Workshop on Scratch

2020 DRAWBOT INSTALLATION AND USE. Robert Ashford Henry Arnold 4-H OABB

Programming with Scratch

Lesson 2 Game Basics

ZX Distance and Gesture Sensor Hookup Guide

Servo board bit machine software use: QSC32 Servo controller front. QSC32 Servo controller back

MultiSensor 6 (User Guide)

Cyber Security Awareness Game Using Scratch Bit by Bit: Advancing Cyber Security

a. the costumes tab and costumes panel

In this project you ll learn how to create a game, in which you have to match up coloured dots with the correct part of the controller.

LESSONS Lesson 1. Microcontrollers and SBCs. The Big Idea: Lesson 1: Microcontrollers and SBCs. Background: What, precisely, is computer science?

Arduino Control of Tetrix Prizm Robotics. Motors and Servos Introduction to Robotics and Engineering Marist School

Whack-a-Witch. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

The Motor sketch. One Direction ON-OFF DC Motor

In the Mr Bit control system, one control module creates the image, whilst the other creates the message.

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

Introduction 1. Download socket (the cable plugs in here so that the GENIE microcontroller can talk to the computer)

ezsystem elab16m Light Sensing Robot

Programmable Control Introduction

Arduino Advanced Projects

CodeBug I2C Tether Documentation

PLAN DE FORMACIÓN EN LENGUAS EXTRANJERAS IN-57 Technology for ESO: Contents and Strategies

HOMANN DESIGNS. DigiSpeed. Instruction manual. Version 1.0. Copyright 2004 Homann Designs.

Welcome to Arduino Day 2016

Adafruit 16-Channel PWM/Servo HAT & Bonnet for Raspberry Pi

Build a Mintronics: MintDuino

WifiBotics. An Arduino Based Robotics Workshop

Adafruit 16-Channel PWM/Servo HAT for Raspberry Pi

Let s start by making a pencil, that can be used to draw on the stage.

TOP SERVO SIGNAL 5 SERVO SIGNAL 3 SERVO SIGNAL 4 SERVO SIGNAL 6 T B T B T B T B T B SERVO TRIGGER 1 BOTTOM

Cardboard Circuit Playground Express Inchworm Robot

La Malinette is an open source project by Reso-nance Numérique Programming Interactivity Kit

Programming Design. ROBOTC Software

Tilt Sensor Maze Game

Robot Programming Manual

Guide to LED and Hobby Lighting Projects Documentation

Electronics Merit Badge Kit Theory of Operation

For Experimenters and Educators

Setup Download the Arduino library (link) for Processing and the Lab 12 sketches (link).

Directions for Wiring and Using The GEARS II (2) Channel Combination Controllers

Lighthouse Beginner s soldering kit

A Day in the Life CTE Enrichment Grades 3-5 mblock Robotics - Simple Programs

Some prior experience with building programs in Scratch is assumed. You can find some introductory materials here:

GetTutorialized Workshops Brochure-2017

Simple Servo USER Instructions

Transcription:

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl S4A - Scratch for Arduino Workbook

1) Robotics Draw a robot. Consider the following and annotate: What will it look like? What will it do? How will you as a user interact with it? Robots are devices, sometimes they can be programmable. Some robots can sense and interact with their environment, perhaps even begin to learn with the incorporation of Artificial Intelligence. Some robots may be created for a certain purpose such as factory robots, repeating the same tasks in potentially dangerous environments. Within this activity book you will be developing your own Arduino Project. Arduino is a micro-controller, which is a small computer that you can use to send and receive messages to and from other electrical components. It is used similar to a motherboard, inside your computer - you can connect various components to it and build up your electrical circuits. Usually Arduinos are programmed using a programming language called C, this is a language commonly used within industry but can be initially complex to grasp, particularly for beginners. Alternatively, you can use drag and drop programming environments where the focus is on the concepts behind the build of code blocks rather than worrying about syntax errors. Scratch for Arduino is a good example of this. S4A (Scratch for Arduino) is a drag and drop programming environment based on the MIT creation Scratch. It has been modified to connect to an Arduino plugged in via USB, offering a variety of additional code blocks to implement and create scripts to control the Arduino and attached components. 1

S4A can be downloaded onto the following operating systems: Mac, Linux and Windows. Make sure this is installed correctly and opened before continuing. Scratch has 5 main sections, firstly starting from the top left you have a list of categories to choose from. As you select each one you can see in the box below different instructions appear in the box directly below (colour co-ordinated), these can be used to create your game by dragging them across to the right where the scripts can be used for your project. On the right of the screen, you can see the white box with the Arduino drawing inside, this is your project. As you begin developing your project, you can play and stop it using the green flag and red circle buttons above. There is one last section, this is your library below the project screen. As you begin connecting more boards, these can be added as sprites, you can see them all being stored in your project library here. 2) S4A Start combining blocks of code and dragging on pieces to build up practice scripts. Note how certain blocks connect and see that all blocks need to begin with a Control block - colour coded in yellow. Most of the blocks appropriate to an Arduino project are available in the Motion category (colour coded in the darker blue), see the Top Tips for a breakdown of the purpose of each of the code blocks. 2

2) Scratch vs S4A If you already have a familiarity with the Scratch interface or are able to download Scratch onto your computer, what are the biggest differences you notice between the software? Can you see how the new code block additions can be implemented into your scripts to build up an Arduino project, rather than a game or animation? Now that you are familiar with the S4A interface, let s have a look at the micro-controller you will be using throughout this activity book. Below is an explanation of some of the elements of the Arduino board: The U S B p ow e r connection, to plug into your computer. Reset button These are pins that are used to connect components to the Arduino, enabling the sending and receiving of messages between components around an electronic circuit. The pins range from Input & Output, digital & analogue and power pins. This is the external power supply connection. You could attach a battery pack here. These are also pins used to connect components to, enabling communication and to build a n electrical circuit. 3

3) LED circuit In an workshop environment there will be a pre-made LED circuit to connect to the Arduino, although if you wish to build your own follow the instructions and diagram below: Attach the jumper wires to the Arduino and the breadboard. Next, insert the appropriate resistor. Finally insert the LED and ensure the USB connection is attached to the computer as a power source. LED USB 4

S4A- Scratch for Arduino Here is where you begin more confidently using the code blocks on S4A. So far you have got your LED to shine successfully once power has been supplied via USB. But how could you get the LED to shine on, then off and repeat this continuously? As you know all commands on S4A/Scratch must begin with a Control block. There is also some code in the Control category that will allow you to repeat the embedded instructions...forever. Referring back to the Motion category will enable you to specify which digital pin to reference. If you are using the LED circuit issued within a Technocamps workshop, the LED should be plugged into Pin 13, double check this just in case. 4) Flashing LED Add instructions on S4A to tell the LED to turn on, then off again. Don t forget to check which pin you have your LED plugged into to reference correctly in your code blocks. Also, if you wish to slow down the speed of the on and off flashes, you could use a Wait command from the Control category and set your chosen time to pause. 5

5) Flashing LED with a button Add a switch (button) to your Arduino circuitry. This will control the flashing of the Arduino, you will need to alter the circuit from the previous task to a circuit similar to below. When the button is pressed down the circuit is completed so power is supplied to the LED, when it is released the circuit it incomplete. LED USB 6

Next you will be using 2 new elements of your Arduino kit: Magician Chassis and the Motor Controller. The motor controller lets you move 2 motors controlled by your Arduino board, it can control the speed, the brakes and direction of each independently. The Magician Chassis has 2 gear-motors and enables you to attached the Arduino and Motor controller on-top of it so the entire robot can maneuver around. 6) Change over Unplug the LED circuit and connect the Arduino to the motor controller and the magician chassis. 7) Motor Controller As you can see, the motors are both wired onto the shield, in the ports A and B. A battery pack will also be needed here (if not provided) which should be wired into the over port of the shield. Each motor has a direction that it spins in, and a power for how fast they are spinning. The direction of the motors initially need to be set, using S4A. You can see the required directions and powers in the table below. Motor B Motor B Motor B Use your knowledge and familiarity of S4A to do the commands for When up is pressed, When down is pressed, When Left is pressed, When Right is pressed and When Space is pressed. Up has been done as an example below: DIRA DIRB PWMA PWMB Direction of A (Pin 12) Direction of B (Pin 13) Power of A (Pin 3) Power of B (Pin 11) 7

Congratulations you have successfully built an Arduino robot, commanded to move using the S4A interface. 8

www.technocamps.com