-
Notifications
You must be signed in to change notification settings - Fork 1
/
roomba_ctrl.sh
35 lines (28 loc) · 1.23 KB
/
roomba_ctrl.sh
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
# these are iRobot Roomba codes
#
# 136 Large / Clean
# 132 Spot
# 143 Seek Dock
# The remote control IR stream consist of 8 bits each 4ms in duration. According to the paper,
# each bit is started by a 1ms low period. If the value is 0, the pulse stays low for 2 more ms.
# If the pulse goes high for 2ms if the value is 1. The bit is ended by sending a 1ms high burst.
# Grabbed from a working IR remote with IrScrutinizer (see iRoomba at http://rcoid.de/remotefiles.html)
# clean: Freq=38000Hz[+3036,-981,+981,-3036,+981,-3036,+981,-3036,+3036,-981,+981,-3036,+981,-3036,+981,-50100][][]
# spot: Freq=38000Hz[+3036,-981,+981,-3036,+981,-3036,+981,-3036,+981,-3036,+3036,-981,+981,-3036,+981,-50100][][]
# dock: Freq=38000Hz[+2994,-1021,+1021,-2994,+1021,-2994,+1021,-2994,+2994,-1021,+2994,-1021,+2994,-1021,+2994,-50100][][]
param=dock
if [ ! -z "$1" ]; then
param=$1
fi
case $param in
clean)
raw=3036,981,981,3036,981,3036,981,3036,3036,981,981,3036,981,3036,981,50100
;;
spot)
raw=3036,981,981,3036,981,3036,981,3036,981,3036,3036,981,981,3036,981,50100
;;
dock)
raw=2994,1021,1021,2994,1021,2994,1021,2994,2994,1021,2994,1021,2994,1021,2994,50100
;;
esac
curl -G http://192.168.1.9 --data-urlencode "raw=$raw"