Satellite Observers Workbench. NOT yet complete, just published for forum posters to \"cherry pick\" pieces of code as requiered as an example.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers nexstar_align.c Source File

nexstar_align.c

00001 /****************************************************************************
00002  *    Copyright 2010 Andy Kirkham, Stellar Technologies Ltd
00003  *    
00004  *    This file is part of the Satellite Observers Workbench (SOWB).
00005  *
00006  *    SOWB is free software: you can redistribute it and/or modify
00007  *    it under the terms of the GNU General Public License as published by
00008  *    the Free Software Foundation, either version 3 of the License, or
00009  *    (at your option) any later version.
00010  *
00011  *    SOWB is distributed in the hope that it will be useful,
00012  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *    GNU General Public License for more details.
00015  *
00016  *    You should have received a copy of the GNU General Public License
00017  *    along with SOWB.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  *    $Id: main.cpp 5 2010-07-12 20:51:11Z ajk $
00020  *    
00021  ***************************************************************************/
00022 
00023 #include "sowb.h"
00024 #include "osd.h"
00025 #include "nexstar.h"
00026 #include "xbox360gamepad.h"
00027 #include "user.h"
00028 
00029 /** nexstar_force_align
00030  *
00031  * On boot-up if main() detects the Nexstar is not aligned
00032  * full control is passed here to force the user to align 
00033  * the Nexstar.
00034  */
00035 void nexstar_force_align(void) {
00036     char c, buf[32];
00037 
00038     osd_stringl(11, buf, sprintf(buf, "  Please align the NexStar"));
00039     osd_stringl(12, buf, sprintf(buf, "  Press 'start'  when done"));
00040     
00041     do {
00042         c = 0;
00043         while(c != BUTT_START_PRESS) {
00044             c = user_get_button(false);
00045         }
00046     }
00047     while(!_nexstar_is_aligned());
00048     
00049     osd_clear_line(11);
00050     osd_clear_line(12);
00051     
00052     _nexstar_set_tracking_mode(0);
00053     
00054 }