Flowcharts for Picaxe BASIC

Similar documents
Using IPACS Webserver:

HYPERSTUDIO TOOLS. THE GRAPHIC TOOL Use this tool to select graphics to edit. SPRAY PAINT CAN Scatter lots of tiny dots with this tool.

Microsoft Excel 2007

Click Here to Begin OS X. Welcome to the OS X Basics Learning Module.

Programmable timer PICAXE programming editor guide Page 1 of 13

How To Upload Your Newsletter

Please click double click on the icon labeled Internet Explorer, the picture is a blue letter E.

How to make a Work Profile for Windows 10

Outline. Debugging. In Class Exercise Solution. Review If Else If. Immediate Program Errors. Function Test Example

MAKING TABLES WITH WORD BASIC INSTRUCTIONS. Setting the Page Orientation. Inserting the Basic Table. Daily Schedule

Introduction to SPSS

Editing Videos. Overview. 1. Open the Editor

A Guide to Autodesk Maya 2015

OPEN THE HOTLINE CLIENT

Quick Guide OneNote. What is OneNote?

Let s Make a Front Panel using FrontCAD

Tabbing Between Fields and Control Elements

Let s begin by naming the first folder you create Pictures.

Map Direct Lite. Contents. Quick Start Guide: Map Navigation 8/17/2015

Module 1: Introduction RStudio

Learning to use the drawing tools

Barchard Introduction to SPSS Marks

Autodesk Inventor Design Exercise 2: F1 Team Challenge Car Developed by Tim Varner Synergis Technologies

GUARDIAN ALARM SYSTEMS

You might think of Windows XP as a set of cool accessories, such as

Barchard Introduction to SPSS Marks

File Storage & Windows Tips

Using Garage Band to Record a Podcast

City of Richmond Interactive Map (RIM) User Guide for the Public

Step-by-step guide to dubbing (ADR) in Audacity

SharePoint: Fundamentals

PI3000. User Guide PASSENGER INFORMATION SYSTEM. rev 1.2

Adobe Illustrator. Quick Start Guide

Here we will look at some methods for checking data simply using JOSM. Some of the questions we are asking about our data are:

First Walkthrough: Fundamentals of Camtasia Studio

Sketching Data

Fruit Snake SECTION 1

This is the opening view of blender.

Word 2003: Flowcharts Learning guide

SketchUp Tool Basics

Using Microsoft Word. Text Editing

Student Success Guide

Making ecards Can Be Fun!

Add notes to a document

The first thing we ll need is some numbers. I m going to use the set of times and drug concentration levels in a patient s bloodstream given below.

Working with Pages... 9 Edit a Page... 9 Add a Page... 9 Delete a Page Approve a Page... 10

Adding content to your Blackboard 9.1 class

Agenda. First Example 24/09/2009 INTRODUCTION TO VBA PROGRAMMING. First Example. The world s simplest calculator...

ELEC451 Integrated Circuit Engineering Using Cadence's Virtuoso Layout Editing Tool

Kurzweil Cheat Sheet

PHOTOPLUS HELP GUIDE

Using web-based

Click the buttons in the interactive below to learn how to navigate the Access window.

Quick Start Guide. Overview Adding Box+ImageTrust to your Box account Scanning with Box+ImageTrust

Online Plan Room Viewer View Mode Quick Start Supplementt Version 10.7

Title of Resource Introduction to SPSS 22.0: Assignment and Grading Rubric Kimberly A. Barchard. Author(s)

Introduction to GIS & Mapping: ArcGIS Desktop

Here we will look at some methods for checking data simply using JOSM. Some of the questions we are asking about our data are:

EE261 Computer Project 1: Using Mentor Graphics for Digital Simulation

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

TurboCAD Pro V17 Workplanes

Photoshop tutorial: Final Product in Photoshop:

WordEmbed. CINDEX Tutorial. Cindex Tutorial

Microsoft Word 2011 Basics

TRAINING GUIDE. Tablet Cradle to Mobile GIS

Basics of Adobe Premiere

Bucknell University Digital Collections. LUNA Insight User Guide February 2006

Lab 3: Digitizing in ArcMap

SharePoint: Fundamentals

Computer Essentials Session 1 Step-by-Step Guide

Introduction to Windows

EchoSub v1.2 EchoStyle

Learning and Development. UWE Staff Profiles (USP) User Guide

Prezi Quick Guide: Make a Prezi in minutes

Gratitude Journal Presented by

LEARN OPENSTREET MAP FOR TANZANIA PROJECT 2501 FIRST SIGN UP FOR AN ACCOUNT HERE

Getting Started Guide

OnCOR Silverlight Viewer Guide

Data. Selecting Data. Sorting Data

Reading: Managing Files in Windows XP

Welcome to the world of .

Getting Started with Amicus Document Assembly

On the Web sun.com/aboutsun/comm_invest STAROFFICE 8 DRAW

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step.

Creating and Using an Account

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

Section 1. System Technologies and Implications. Modules

Note: Photoshop tutorial is spread over two pages. Click on 2 (top or bottom) to go to the second page.

Windows 8.1. Tiles come in four shapes: small, medium, wide, and large. The red outlined tiles are live tiles.

Mac: Beyond Basics. Window 2 (Microsoft Word) Window 1 (folder contents)

SPRITES Making Things Move Around The Screen

Introduction to Desktop Publishing

The smarter, faster guide to Microsoft Outlook

CS 051 Homework Laboratory #2

Course Exercises for the Content Management System. Grazyna Whalley, Laurence Cornford June 2014 AP-CMS2.0. University of Sheffield

A Brief Introduction of how to use Audacity

Tutorial 1 Importing Data

Chapter One: Getting Started With IBM SPSS for Windows

SWITS User Manual. Accessing SWITS. This document focuses on the elements required to Access SWITS. Total Pages: 5

Randy H. Shih. Jack Zecher PUBLICATIONS

Transcription:

Flowcharts for Picaxe BASIC Tech Studies Page 1 of 11

In the college you will use the PICAXE Programming Environment in order to carry out all of your program writing, simulating and downloading to the target processor. If you want to get ahead of the game then you can, quite legally there are no restrictions on the software use this same software at home. In order to download the software you can either type the following in to your web browser http://hame.uk.com/jwc/html/syscontrol.html or you can use your phone to take you to the web-page by scanning the QR code on the right >>> Download and install as for any other piece of software. Page 2 of 11

Start up the PICAXE Programming environment by double clicking on the icon on your desktop >> When the program starts select the following PICAXE mode PICAXE-28X2/40X2 from the drop down list. This should take you to the start-up setting as shown below. This is the default program editing page. Where you will type in / write all of your PICAXE programs. There is a second environment available to us for programming and we will start it up now:- Page 3 of 11

Before we start the program let s take a look at what a flowchart is. A flowchart is a form of graphical programming. It allows us to identify the correct program sequence and further it helps sort out the logic of the program. Every flowchart begins with a element and has many other elements in between. element and usually, but does not always end with a Some of the elements you will use when writing your flowcharts are as follows:- Inputs and Outputs Processes Decisions All elements are joined by directional lines or There are other elements but these are the main elements that we will use to start with others will be added as we progress. Here is a simple flowchart:- program start do something make a decision [loop back] program terminate Let s take a closer look at how we can draw up flowcharts for all of the programs we have met so far. Page 4 of 11

Examine the tool-bar at the top of the screen and click on the flowchart button. This will open a new programming editor environment. This programming environment is for a graphical programming language called Flow Charting. First I will try and explain all of the graphical symbols. The default toolbar is shown below split into each button. Select Zoom area Pan Add connection points Output commands If commands Sub commands Select within area Zoom in or out Draw lines Add label movement Delay commands Other commands Page 5 of 11

Each button that you select from the main toolbar will bring up another toolbar that expands available graphical commands. Let s look at the first example program from your hand-out Example-1. The next flowchart is a bit more complex. It has a decision making process in it. You may have noticed that each element of a flowchart has only one input and one output the only element that has more than two is the decision element this has three an input and two outputs. The ouputs are the result of a question and can be either true or false, good or bad or just yes or no. As an example let us imagine that you are writing a program that will do one thing if the input pinc.0 = 0 and will do an other thing if the input pinc.0 = 1. We can represent this in code as: At the if statement just ask the question, is pinc.0 = 0 if the answer is NO then follow the N route out of the decision element otherwise follow the Y route. Simple, yes? Earlier in the text I said that we can sort out LOGIC using flowcharts, if you find that there is more than just a yes or no answer at a decision element then you must have more than one question at this point therefore you re-think your question and re-draw your flowchart. Page 6 of 11

Page 7 of 11

So how do we go about building a flowchart? Let s look at the Example1 program and construct the flowchart shown at the top of page 6. Open a new programming editor environment and select the flowchart button. The people at PICAXE have started your flowchart for you by placing the start element on the page for you:- Perhaps now is a good time to save your first flowchart. Click on File and select save as >> When the dialogue box opens up type in Example1 and click OK remember, save your programs often too many times I hear the cry go up that someone has lost the program that they have been working on because a computer has failed or frozen. This is not the computer s fault, if you have been working on a program for say 5 minutes then stop and save it, if you decide that you want to run a simulation then stop and save before you do it or if you decide you want to download your latest masterpiece to the target microprocessor then stop and save your file before you do it you have been warned. Some people get quite offended and annoyed when I laugh at them when they lose their work just let me say, if you feel that you may be one of these people THEN SAVE YOUR WORK FREQUENTLY SAVE, SAVE, SAVE YOUR WORK- YOU HAVE BEEN WARNED. Examine the first line of program code This is an output the program is saying set the output pin 7 HIGH Look at the button-bar and select the OUT button This will open another button bar Examine the options Page 8 of 11

The HIGH option is pre-selected and you can click anywhere on the yellow area to drop the HIGH element on the page But I suggest you position it one or two dots below the START element. You should now have something similar to that shown on the right When we insert the HIGH element the default is 0, but we want HIGH = 7. No problem click on the arrow at the left of the button bar. Click on the HIGH element look down at the bottom left of the editing area und you should see an input box like this >> Click on the small arrow on the right of the box and select the value 7 from the drop-down list >> Many of the options that we have to change use this same process. Click on the curly arrow to go back to the main toolbar We will now join these elements together using the lines element click on it now Notice now that as you move the cursor about the line terminators on the elements change to a bubble outlined in red this indicates that a line can either start or end at this point >> Make sure the bubble shows on the START termination CLICK on it and drag towards the HIGH element it can be difficult to position the arrow at the correct point but a bit of practice helps. If you end up with a line that you feel is incorrect the just place the cursor over it and click it should disappear, sometimes when the termination points are close together then drawing the line upwards makes the arrow snap to the required point >> Examine the next line of program code We now need to insert a DELAY element >> This brings up another button bar: Again examine the options We want to PAUSE the program therefore we will select >> Again drop the element a couple of dots below the previous element >> Now as before select the arrow on the left of the button-bar, select the element then at the bottom of the screen change the default value of 1000 to the required 2000. Watch out if you hit the delete key the program will think you are deleting the element just click on NO and you should be ok. Now go back to the main button-bar and join the elements. Page 9 of 11

Your flowchart should now look like this >> You might want to expand the editing area to fill the available screen space do this by clicking on the MAXIMISE button at the top right of the editing area. OK repeat this until you are down to PAUSE 3000 >> In order to get everything visible on the screen you may have to ZOOM out. This program employs a strange method for this. Select the ZOOM IN OUT button >> Other than the cursor changing to a magnifying glass with a + and next to it nothing else seems to happen. If you click with the left mouse button and move the cursor UP and DOWN then the zooming will take place. OK things could end up so small that they are unreadable if we keep building our flowchart downwards. In order to prevent this we can continue our construction on the right hand side of the current program [never on the left] and join the bottom of the left most program with the top of the right >> Now complete the flowchart for Example1 Page 10 of 11

Just a question HOW MANY TIMES DID YOU SAVE YOUR WORK? Get used to saving your work if you don t you may well regret it. Now take a look at the hand-out which contains the programming examples and see if you can create flowcharts for the given programs. Page 11 of 11