13.07.2015 Views

An Integrated, Modular Simulation System for Education ... - Cal Poly

An Integrated, Modular Simulation System for Education ... - Cal Poly

An Integrated, Modular Simulation System for Education ... - Cal Poly

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Game Joystick Driver Simulink S-function/***************************************************************************** MODULE: game_stick.c** AUTHOR(S): Eyal Lebedinsky / Doug Hiranaka** DATE: February 11, 1999** Copyright (c) ALL RIGHTS RESERVED* <strong>Cal</strong> <strong>Poly</strong> San Luis Obispo 1998** REVISION HISTORY:** REV AUTHOR DATE DESCRIPTION** This was part of the flight simulator ’fly8’.* Author: Eyal Lebedinsky (eyal@ise.canberra.edu.au).* 0 EL Creation joytest.c* 1 dkh 2-8-99 removed test functions* 2 dkh 2-11-99 converted into s-mex <strong>for</strong>mat** S-mex: See simulink/src/sfuntmpl.doc** S-mex Copyright (c) 1990-1998 by The MathWorks, Inc. All Rights Reserved.* $Revision: 1.3** This S-function block Reads the commanded stick position from a game* joystick and sends out values from +-1*****************************************************************************/#define S_FUNCTION_NAME game_stk#define S_FUNCTION_LEVEL 2#include "simstruc.h"#include #include /* #include */#include /* This is part of the flight simulator ’fly8’.* Author: Eyal Lebedinsky (eyal@ise.canberra.edu.au). */#define JS_PORT#define JS_TIMEOUT 32000#define JS_READ0x201inp (JS_PORT)typedef unsigned shorttypedef unsigned inttypedef unsigned longUshort;Uint;Ulong;#define READING(JS_TIMEOUT-i)struct stick {UshortUshort};a[4];b[4];168

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!