Ejemplo n.º 1
0
#!/usr/bin/env python3
"""
CLI for zeroing the rotator.
Intended for testing and setup uses.

author: Marion Anderson
date:   2018-07-28
file:   zero.py
"""
from __future__ import absolute_import, print_function

from rotator import Rotator

# Rotator setup
rot = Rotator()
rot.attach(23, 17, 22)  # from my soldershield design
rot.zero()  # zero before doing anything
Ejemplo n.º 2
0
"""
from __future__ import absolute_import, print_function

import os
import signal
import sys

import serial

from rotator import Rotator

print('\nStarting interface.py')

# Rotator setup
rot = Rotator(23, 17, 22)
rot.attach()
print('  Rotator attached')
rot.zero()  # zero before doing anything
homedir = os.environ['HOME']
ser = serial.Serial(port=homedir + '/.satcomm/ttySatR',
                    baudrate=38400, timeout=0.5)
print('  Serial port open')

# SIGINT Handling
def SIGINT_handler(sig, frame):
    """Gracefully exits from C-c."""
    print('Releasing resources and exiting interface')
    rot.detach()
    # ser.close()
    sys.exit(0)
signal.signal(signal.SIGINT, SIGINT_handler)