Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 37 lines (28 sloc) 0.707 kb
e6051fe @dbasden a simple example
authored
1 #! /usr/bin/env python
2
3 from rtlsdr import RtlSDR
4 import sys
5
6 if __name__ == "__main__":
7
8 if len(sys.argv) < 2:
9 print >> sys.stderr, sys.argv[0], "<outfile>"
10 sys.exit(1)
11
12 if RtlSDR.get_device_count() < 1:
13 raise IOError("No known devices found")
14
15 s = RtlSDR(0, 105700000, 1024000)
16
17 # This is actually a property that changes the frequency
18 s.frequency = 54000000
19 s.frequency = 927000000
20 s.frequency = 435012000
21 s.frequency = 145125000
22 s.frequency = 130100000
23 s.frequency = 105700000
24
25 s.reset_buffer() # Must do before first read
26 buf = s.read()
27 outf = open(sys.argv[1], "w")
28
29 try:
30 while True:
31 outf.write(s.read())
32 except KeyboardInterrupt:
33 pass
34 finally:
35 outf.close()
36 s.close()
Something went wrong with that request. Please try again.