-
Notifications
You must be signed in to change notification settings - Fork 0
/
movedown
executable file
·70 lines (66 loc) · 2.03 KB
/
movedown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# deplacer vers le bas
# usage: movedown DD S ; DD=degrees S=speed 1=high 2=med 3=low
#
# Copyright (C) 2010 Martin Aube
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact: [email protected]
#
if [ "$1" = "" ]
then echo "usage: movedown DD MM SP ; DD=degrees MM=minute SP=speed 1=high 2=med 3=low"
exit 0
fi
if [ "$2" = "" ]
then echo "usage: movedown DD MM SP ; DD=degrees MM=minute SP=speed 1=high 2=med 3=low"
exit 0
fi
if [ "$3" = "" ]
then echo "usage: movedown DD MM SP ; DD=degrees MM=minute SP=speed 1=high 2=med 3=low"
exit 0
fi
readmount "EL" 0
read D M S < mount.tmp
let min="$1"*60+"$2"
rm -f mount.tmp
if [ "$3" -eq 1 ]
then echo "#:RS#" > /dev/ttyS0
let timi=11*min/6000
let timd=11*min/600-timi*10
let timc=11*min/60-timd*10-timi*100
let timm=11*10*min/60-timc*10-timd*100-timi*1000
let timn=0
elif [ "$3" -eq 2 ]
then echo "#:RM#" > /dev/ttyS0
let timi=16*min/600
let timd=16*min/60-timi*10
let timc=16*min/6-timd*10-timi*100
let timm=16*10*min/6-timc*10-timd*100-timi*1000
let timn=0
elif [ "$3" -eq 3 ]
then echo "#:RC#" > /dev/ttyS0
let timi=3*min/60
let timd=3*min/6-timi*10
let timc=3*10*min/6-timd*10-timi*100
let timm=3*100*min/6-timc*10-timd*100-timi*1000
let timn=3*1000*min/6-timm*10-timc*100-timd*1000-timi*10000
fi
sleep 0.2
echo "#:Ms#" > /dev/ttyS0
sleep $timi"."$timd$timc$timm$timn
echo "#:Qs#" > /dev/ttyS0
readmount "EL" 0
read D M S < mount.tmp
exit 1