Flowcharts and Schematics (Using Visio). Flowcharts An Algorithm is just a detailed sequence of...

Post on 01-Jan-2016

222 views 0 download

transcript

Flowcharts and Schematics (Using Visio)

Flowcharts

An Algorithm is just a detailed sequence of simple steps that are needed to solve a problem.

A program is an implementation of an algorithm in a specific programming language, e.g., PBasic

A Flowchart is a graphical representation of an algorithm.

Symbols

Of the many Symbols available, these 7 Basic Symbols will be used most:

Example 1

DO GOSUB Get_Ir_Remote_Code DEBUG "Remote code: ",

DEC remoteCode GOSUB Bot_CommandLOOP

Example 2

DEBUG "Remote code: "SELECT remoteCode CASE 0 TO 9 DEBUG DEC remoteCode CASE Enter DEBUG "ENTER" CASE ChUp DEBUG "CH+" CASE ELSE DEBUG DEC remoteCode,

" (unrecognized)"ENDSELECT

Example 3

IF remoteCode >= 0 ANDremoteCode <= 9 THEN

DEBUG DEC remoteCodeELSEIF remoteCode = Enter THEN DEBUG "ENTER"ELSEIF remoteCode = ChUp THEN DEBUG "CH+"ELSE DEBUG DEC remoteCode,

" (unrecognized)"ENDIF

Example 4

time VAR Word remoteCode VAR ByteDEBUG "Binary Val Decimal Val”DO remoteCode = 0 DO RCTIME 9, 1, time LOOP UNTIL time > 1000 PULSIN 9, 0, time IF time > 500 THEN remoteCode.BIT0 = 1 RCTIME 9, 0, time IF time > 300 THEN remoteCode.BIT1 = 1 RCTIME 9, 0, time IF time > 300 THEN remoteCode.BIT2 = 1 LOOP

Example 5

Get_Ir_Remote_Code: remoteCode = 0 DO RCTIME 9, 1, time LOOP UNTIL time > 1000 PULSIN 9, 0, time IF time > 500 THEN

remoteCode.BIT0 = 1 RCTIME 9, 0, time IF time > 300 THEN

remoteCode.BIT1 = 1 RCTIME 9, 0, time IF time > 300 THEN

remoteCode.BIT2 = 1 RETURN

Using Visio: start up

Drag shapes to the drawing pane

Drag to place

Double-click to add text

Resize using bounding-box

Connect shapes with connectors

Connect shapes with connectors

Click the lower blue connection point on the shape. A red box appears around the connection point to show that the connector is “glued” to the shape.

Once glued to a shape, the connector moves with the shape

the drawing grid

Grid lines crisscross each drawing page like those on traditional graph paper. A grid helps you position shapes visually on a drawing page, and you can snap shapes to the grid. The grid does not print.

Working with the grid

Show or hide the grid: On the View menu, click Grid.

Set grid spacing: On the Tools menu, click Ruler & Grid.

Snapping: By default, shapes snap to both ruler subdivisions and grid lines. On the Tools menu, click Snap & Glue.

Glue:Glue is what keeps connectors attached to shapes.

Schematics

Schematics are a graphical representation of electrical systems.

Shapes represent components and lines depict connections.

Schematic Symbols

The 180 custom stencil

Custom Stencil for 180 Schematics

Copy the stencil file from this link and store it on your computer. You can store it anywhere, but if you

place it in the following directory: C:\Program Files\MicrosoftOffice\Visio10\1033\Solutions\Electrical Engineeringit will be listed as one of the stencils available under Electrical Engineering.

180 Custom Stencil

Open the stencil as follows: Under the File menu option, select Stencil

followed by Open Stencil... In the pop-up window, enter the directory

where you stored the stencil in the text box labeled Look in:.

If you stored the stencil in the directory recommended above, simply select the folder labeled Electrical Engineering from the directory list contained in the pop-up window.

After designating the directory containing the 180 stencil, select that file, i.e., 180stencil.vss, from the list of stencil files.

180 Custom Stencil

Once you have opened the stencil, you can use it just as you would any other Visio stencil with the caveat that the custom shapes do not have anchor points. This means that you can't glue them to connectors which makes the interface with connectors more tedious.

Now that you know about this stencil, let me add that you are not required to use it.

Example 1 (from Ch 2 of the Robotics Manual)

Example 2---Servos

Example 3---IR Detector

Example 4---From a Previous Project Report

Other Good Stuff in Visio

Group/ungroup: select multiple shapes holding the shift

key down Group shapes:

Selected shapes move as a unit

Good Stuff

Many automatic layout features

Export options under save as: .vsd .html .gif, .jpg, .png .wmf

Hyperlinks If your flow chart gets too big, you can extend it on several

pages. 1. Create the page or document you want to link to.2. Select the shape you want to link from.3. In the Insert menu, select Hyperlink (or use the shortcut

Ctrl+K.) 4. You can have several links from the same shape. 5. To link to another page in the same flowchart document,

browse in the Sub-address box, and select the page. 6. To link to an external document, browse in the Address

box. 7. Click OK when you have added all the hyperlinks you

need. Access the links by right-clicking the shape to select a link. If you create an html document from the flowchart, you

will be able to click on the shape to access the link.