Perfect Game Baseball - msherwood pseudo code backbone Using MVC Convention (Model/View/Controller) With Multimodal I/O

Similar documents
Introduction to Pneumatics

FLUID POWER FLUID POWER EQUIPMENT TUTORIAL OTHER FLUID POWER VALVES. This work covers part of outcome 2 of the Edexcel standard module:

ATM 322 Basic Pneumatics H.W.6 Modules 5 7

TEPPER SCOREBOARD INSTRUCTIONS

Silent Gliss 5100 Autoglide Quick Start Guide

SENSAPHONE APPLICATION NOTE. Functions: C Programming, Pump Control, Data Logging

ISCORE INTEGRATION IOS SCORING GUIDE

Touch Screen Guide. OG-1500 and OG Part # T011

HCLL Scorekeeping Clinic

OMNISPORT 2000 SWIMMING QUICK REFERENCE

Antelope Little League

SIP 1000 OPERATION AND PROGRAMMING MANUAL

Built-in Purge Control Functions

Modelling Today for the Future. Advanced Modelling Control Techniques

Gouwan Strike English Manual

Baseball Scorekeeping for First Timers

SCOREKEEPER S GUIDELINES 2012 (adapted from Scott Cordova)

Guide to Softball Rules and Basics

THE FIELD THE INFIELD

Gas Network Craftsperson

Using the Lego NXT with Labview.

S4W PRO ROBOT. User Manual. paddlepalace.com

VLSI Design 14. Memories

Scoreboard Operator s Instructions MPCX2 Baseball Control

GOLT! RED LIGHT DISTRICT

SCF Softball Club Scoreboard Controller Operation

Temperature Controller CC24-7 ULTRA USER S MANUAL Legion Dr. Mason, MI USA October 2010 Ph. (517) Fax (517)

Instruction and Practice Manual

Softball/Baseball Scorekeeping for First Timers. Written for novice scorekeeper volunteers scoring CHAA Softball/Baseball games.

Written Report of Robot Design

Computer Scorekeeping Procedures Page 1

Electronic Automatic Transmission for Bicycle

Basic Pneumatics. Module 7: Time delay valve and sequence control systems. Academic Services PREPARED BY. January 2013

Soft Systems. Log Flume - 1. Enter Specification. Activity One ACTIVITIES. Help. for Logicator

Sequence of Operations

Copyright 2004 by the Thomas G. Faria Corporation, Uncasville CT No part of this publication may by reproduced in any form, in an electronic

Softball Study Guide

A TECHNICAL REFERENCE

Baseball Scorekeeping for First Timers

Nervous System: Reaction Time Student Version

MOMAUGUIN RECREATION LEAGUE

2015 Shetland Score Keeping Guide

Product Overview. Product Description CHAPTER

Common Umpire Rule Myths

Control of Salinity in the Fish Tank ME 121. Tank Pump Sensor. Figure 1 Schematic of flow loop and salinity control scheme for the fish tank.

Design Envelope Booster. Sequence of operation

TRUE or FALSE. Rules: 2.00 PERSON, TOUCH, STRIKE (e) and 6.05(f) 2. The batter-runner must turn to his right after over-running first base.

TorMinal. Operating instructions V OCE-Rev.L_EN

ASTER ELECTRONIC INTERACTIVE TABLE TENNIS GAME

PSAA League Rules: Machine Pitch Revised: Spring 2012

MODEL 9875 STADIUM BASEBALL SCOREBOARD. Instruction Manual

Figure SM1: Front panel of the multipatcher software graphic user interface (GUI) at the beginning of multipatcher operation.

VOLAR PRODUCTION TRUCK SCOREBOARD CONTROLLER DATA INTEGRATION

Playing with Agent_SimpleSoccer. 1. Start the server 2. Start the agent(s) in NetBeans 3. Start the game: press k and b in the monitor window

Read Before Operating!

LENNOX SLP98UHV DIAGNOSTIC CODES

THE SOUNDBEAM 2 HANDBOOK PART 2 STEP BY STEP

CPE/EE 427, CPE 527 VLSI Design I L21: Sequential Circuits. Review: The Regenerative Property

Rhino VE CE Bulk Unloader Operator s Card

CITY OF AURORA 2015 PLAYER PITCH YOUTH BASEBALL & COMPETITIVE RULES AND REGULATIONS

2013 WIFFLE BALL TOURNAMENT RULES

MICROPROCESSOR ARCHITECTURE

J12 TICKET DISPENSER HOPPER ALL STOP STOP 1 STOP 2 STOP 3 BIG DOUBLE SMALL TAKE PLAY START CURRENT PRODUCTION BOARD TYPE

LSG Single Point Failure Analysis

GATE 2 Part No

MP-70/50 Series Scoreboard Controller User Guide

VLSI Design I; A. Milenkovic 1

CONTROL LOGIC DESCRIPTION DOCUMENT IC-410ND

Madisonville. Spring Baseball Rules 8 Year Old A. Field. a. Bases Bases will be 60 feet apart

Advanced Pump Control for Irrigation Applications

Controlling the prefeeder

Net$ync II. Net$ync II. System Controllers

USER MANUAL. Intelligent Diagnostic Controller IDC24-A IDC24-AF IDC24-AFL IDC24-F IDP24-A * IDP24-AF * IDP24-AFL * IDP24-F * 1/73

Wickets Administrator

Baseball Cutoff and Backup Responsibilities - Pitchers

Homework Hitting (c) Softball-Spot.com PART 1

DeeterFlow Automatic Liquid Dispenser

Declining Weight Blending System Quick Start Manual E Main St Marshall, IL Phone: Fax: Website:

YSC-8330 USER MANUAL XI AN TYPICAL INDUSTRIES CO.,LTD.

Position Controller PS312P_LCD_v2.2

1. The Ohio Hot Stove Baseball League Rules are to apply, unless SYB specifies the rule for league play.

AED Trainer NF1200-T. Operator s Manual

Evaporative Emissions (EVAP) system, checking

APPLICATION NOTES DELOMATIC 4, DM-4 GAS

2018 Supplemental Rules Tee-Ball Division

CBC2 performance with switched capacitor DC-DC converter. systems meeting, 12/2/14

Computer Scorekeeping Procedures

Final Report. Remote Fencing Scoreboard Gator FenceBox

CBA Umpire Test. 3. The pitcher cannot wear a batting glove under his glove, even though the umpire does not think it is distracting to the batter.

BUBBLER CONTROL SYSTEM

CSO/STORMWATER MANAGEMENT. HYDROVEX HHV-E Vortex Driven Regulator

ACV-10 Automatic Control Valve

2015 GTAAA Jr. Bulldogs Memorial Day Tournament

Oerlikon Sputtering Evaporator SOP

Hi Coach! Welcome to Softball Spot!

2018 6U (T-BALL) LEAGUE RULES

Overview. Time Learning Activities Learning Outcomes. 10 Workshop Introduction

Exercise 1: Control Functions

2018 SEASON: MINORS PALOS VERDES LITTLE LEAGUE LOCAL RULES

AHE58/59 AC Servo System

Transcription:

Perfect Game Baseball - msherwood pseudo code backbone Using MVC Convention (Model/View/Controller) With Multimodal I/O Model: DataModel.h/c Use this to store the game states View: Buzzers.h/.c Output sound effects (supplanted by Speaker) Shiftregister.h/c Output visual effects- based off the model, so once model is updated just call viewupdate Speaker.h/c Output sound effects Controller: ADS12.h/c Give time difference control Delay.h/c Calculate delay periods Main.h/c Main controller function- run everything PWMS.h/c Control pulse width modulation and variations Input: Multiplexer.h/c Get input from hit balls, user pitch control, automatic pitch sensing, and swag release Penny.h/c Break beam sensor control for penny input Output: Motors.h/c Run pitch motors and ball elevator (not sensing) Swag.h/c Run swag release (not sensing) MAIN Controller Run Startup Sequence (call all of the modules init functions and init timer/pwms) Update Scoreboard in View Play Anthem in View Loop forever Wait for a penny in Input Set Game To On in the Data Model Update Scoreboard in View Play sound at start in View Loop, while game is not over Wait for pitch in Input Deliver Pitch in Controller using (Output and Input) Wait for pitched ball to register as an outcome in Input Log outcome as event type in Controller Handle the outcome of the hist change Model and update View

** Function: static void Run_Startup(void) ** Initializes all the C32 output pins through ** the modules' init functions. Also initializes the ** TIMER. Startup sequence Controller Initialize Timers Initialize Coin Collector Initialize Multiplexer Initialize Data Model Initialize Shift Register Initialize A/D Initialize Motors Initialize Speakers Initialize Swag ** Function: static void Handle_Hit(char event) ** Handles the logic of a hit event. Access the data model ** and updates the view/outputs Handle Hit Controller case HOME_RUN: Tally Baserunners and add 1 in Model Blink Scoreboard in View Add runs for baserunners plus 1 in Model Clear Bases in Model case TRIPLE: Count baserunners in Controller logic Add runs for baserunners in Model Put runner on third in Model case DOUBLE: Count barerunners in Controller Add runs for baserunners in Model Put man on second in Model case SINGLE: Tally baserunners in Controller Score runs in Controller Put runner(s) on base in Model

case STRIKE: Check for strikeout in Controller If strikeout play sound, blink scoreboard, add out in View and Model If not strikeout, add strike in Model case OUT: Add Out; in Model ; Check end of game in Controller ** Function: static void CheckEndGame(void) ** Checks for possible endgame scenarios. Updates the ** model and controls the view/outputs. CheckEndGame Controller If runs greater than five Blink and update scoreboard in Model and View Clear bases in Model Clear runs in Model Clear outs in Model Set free play in Model Swag to batter in Output Else if outs equals three Blink scoreboard in View Clear Bases in Model Clear Runs in Model Clear Outs in Model If runs less than three swag to pitcher in Output If runs more than three swag to batter in Output Play sounds in View ** Function: static void Pitch(void) ** Reads in the pitch speed and curve amount. ** Turns pitching wheel on to correct amount. ** Turns ball return on. ** Senses when ball is delivered to pitching wheel ** Turns ball return off Pitch Controller Run pitching motors in Output Play sounds in View

Start Stepper Motor in Output Wait for Break Beam in Input Stop stepper motor in Output Continue to run pitching motors until ball is delivered in Input and Output ** Function: void RunPitchingMotors(char input) ** If input is high, turns both pitching motors on to a duty cycle between ** MIN_PITCH _PWM and MAX_PITCH_PWM. ** dutycycle = MIN_PITCH_PWM + (0-100)*(Max_PWM - Min_PWM)/100 RunPitchingMotors(char input) Output Check speed and curve inputs Set pulse widths per algorithms Turn motors on ** Function: char CheckHit(void) ** Loops on the multiplexer to find a switch closed event. ** Use pins T5,6,7 for multiplexer control, T4 for mux out. ** @returns a symbol event of what happened Check Hit Input Cycle through MUX channels 0-7. Start with 0... Loop, forever Timout if needed Return outcome (single, double, etc) ** Function: char CheckPitch(void) ** Loops on the multiplexer to find a switch closed event (for the pitcher). ** Use pins T5,6,7 for multiplexer control, T4 for mux out. ** @returns a symbol of pitch happening Check Pitch Input Wait for pitch button to be pushed Return Pitch ** Function: void CollectPenny(void) ** Waits for a penny insertion. CollectPenny Input Wait for penny to be deposited by user ** Function: void UpdateShifter(void)

** Updates the LEDs 0-15. Every time. UpdateShifter(void) View Feed in values for scoreboard serially pulsing clock between each bit ** Function: void SwagIO(char winner) ** Releases swag to the winner, passed as a symbol constant. SwagIO Output If batter won Deliver swag to batter If pitcher won Deliver swag to pitcher