1 / 5

Flowol subroutines

Flowol subroutines. Subroutines are used to: Simplify your code to make it easier to read (or for someone else to read) Avoid having to write the same block of code a number of times Break a bigger problem into smaller steps. Flowol subroutines.

urbano
Télécharger la présentation

Flowol subroutines

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Flowol subroutines Subroutines are used to: Simplify your code to make it easier to read (or for someone else to read) Avoid having to write the same block of code a number of times Break a bigger problem into smaller steps

  2. Flowol subroutines Subroutines are smaller programs which run inside larger programs Drag out a new START block Make the block a SUB Give the SUB a sensible name Code the SUB End with a STOP block

  3. Flowol subroutines SubflashLights Turn red on Delay 1 second Turn blue on Delay 1 second Turn yellow on Delay 1 second Turn lights off Delay 1 second Stop You should be able to make the lights do more interesting flashing patterns than this As the Big Wheel rotates the lights need to flash on and off.

  4. Flowol subroutines Start Is Input 1 on? If Yes Run Sub flashLights Turn Motor A Forward Loop back to Start If No Turn Motor A off Loop back to start How could you turn the lights off once they start flashing? Turning the wheel…

  5. Flowol subroutines Key vocabulary: Subroutine Efficiency Loop Condition Pseudo Code

More Related