LoBeep.c

Go to the documentation of this file.
00001 /**
00002    \file  Robots/LoBot/irccm/LoBeep.c
00003    \brief Some quick functions to have the iRobot Create make some noise.
00004 
00005    This file defines the sound generation functions for Robolocust's
00006    low-level control program that runs on the iRobot Create's Command
00007    Module.
00008 */
00009 
00010 /*
00011  ************************************************************************
00012  * The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2005   *
00013  * by the University of Southern California (USC) and the iLab at USC.  *
00014  * See http://iLab.usc.edu for information about this project.          *
00015  *                                                                      *
00016  * Major portions of the iLab Neuromorphic Vision Toolkit are protected *
00017  * under the U.S. patent ``Computation of Intrinsic Perceptual Saliency *
00018  * in Visual Environments, and Applications'' by Christof Koch and      *
00019  * Laurent Itti, California Institute of Technology, 2001 (patent       *
00020  * pending; application number 09/912,225 filed July 23, 2001; see      *
00021  * http://pair.uspto.gov/cgi-bin/final/home.pl for current status).     *
00022  ************************************************************************
00023  * This file is part of the iLab Neuromorphic Vision C++ Toolkit.       *
00024  *                                                                      *
00025  * The iLab Neuromorphic Vision C++ Toolkit is free software; you can   *
00026  * redistribute it and/or modify it under the terms of the GNU General  *
00027  * Public License as published by the Free Software Foundation; either  *
00028  * version 2 of the License, or (at your option) any later version.     *
00029  *                                                                      *
00030  * The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope  *
00031  * that it will be useful, but WITHOUT ANY WARRANTY; without even the   *
00032  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      *
00033  * PURPOSE.  See the GNU General Public License for more details.       *
00034  *                                                                      *
00035  * You should have received a copy of the GNU General Public License    *
00036  * along with the iLab Neuromorphic Vision C++ Toolkit; if not, write   *
00037  * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,   *
00038  * Boston, MA 02111-1307 USA.                                           *
00039  ************************************************************************
00040 */
00041 
00042 /*
00043    Primary maintainer for this file: Manu Viswanathan mviswana usc edu
00044    $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Robots/LoBot/irccm/LoBeep.c $
00045    $Id: LoBeep.c 12838 2010-02-14 14:28:03Z mviswana $
00046 */
00047 
00048 /*------------------------------ HEADERS ------------------------------*/
00049 
00050 // lobot headers
00051 #include "LoBeep.h"
00052 #include "LoIO.h"
00053 #include "LoTimer.h"
00054 #include "LoOpenInterface.h"
00055 
00056 /*-------------------------- INITIALIZATION ---------------------------*/
00057 
00058 void lo_init_beeps(void)
00059 {
00060    lo_tx(LOBOT_OI_CMD_DEFINE_SONG) ;
00061    lo_tx(LOBOT_BEEP_STARTUP) ;
00062    //lo_tx(16) ;
00063    lo_tx(7) ;
00064    lo_tx(76) ; lo_tx(29) ;
00065    lo_tx(79) ; lo_tx(22) ;
00066    lo_tx(76) ; lo_tx(15) ;
00067    lo_tx(76) ; lo_tx(7)  ;
00068    lo_tx(81) ; lo_tx(15) ;
00069    lo_tx(76) ; lo_tx(15) ;
00070    lo_tx(74) ; lo_tx(15) ;
00071    /*
00072    lo_tx(76) ; lo_tx(29) ;
00073    lo_tx(83) ; lo_tx(22) ;
00074    lo_tx(76) ; lo_tx(15) ;
00075    lo_tx(76) ; lo_tx(7) ;
00076    lo_tx(84) ; lo_tx(15) ;
00077    lo_tx(83) ; lo_tx(15) ;
00078    lo_tx(79) ; lo_tx(15) ;
00079    lo_tx(76) ; lo_tx(15) ;
00080    lo_tx(83) ; lo_tx(15) ;
00081    */
00082    lo_wait(15) ;
00083 
00084    lo_tx(LOBOT_OI_CMD_DEFINE_SONG) ;
00085    lo_tx(LOBOT_BEEP_HEARTBEAT) ;
00086    lo_tx(1) ;
00087    //lo_tx(109) ; lo_tx(4) ;
00088    lo_tx(36) ; lo_tx(6) ;
00089    lo_wait(15) ;
00090 
00091    lo_tx(LOBOT_OI_CMD_DEFINE_SONG) ;
00092    lo_tx(LOBOT_BEEP_QUITTING) ;
00093    lo_tx(9) ;
00094    lo_tx(76) ; lo_tx(15) ;
00095    lo_tx(83) ; lo_tx(15) ;
00096    lo_tx(88) ; lo_tx(15) ;
00097    lo_tx(76) ; lo_tx(7)  ;
00098    lo_tx(74) ; lo_tx(15) ;
00099    lo_tx(74) ; lo_tx(7)  ;
00100    lo_tx(71) ; lo_tx(15) ;
00101    lo_tx(78) ; lo_tx(15) ;
00102    lo_tx(76) ; lo_tx(29) ;
00103    lo_wait(15) ;
00104 }
00105 
00106 /*----------------------------- BEEPS API -----------------------------*/
00107 
00108 void lo_beep(char beep_id)
00109 {
00110    lo_tx(LOBOT_OI_CMD_PLAY_SONG) ;
00111    lo_tx(beep_id) ;
00112    //lo_wait(100) ;
00113 }
Generated on Sun May 8 08:41:30 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3