コード例 #1
0
import sys

import dotdot
import dovecot
from dovecot.ext import powerswitch


if len(sys.argv) >= 2:
    uid = int(sys.argv[1])
else:
    uid = dovecot.stem_uid()

powerswitch.Eps4m(mac_address='00:13:f6:01:52:d6', load_config=True).set_off(uid)
コード例 #2
0
ファイル: stem_setup.py プロジェクト: dtbinh/dovecot
import dotdot
import dovecot
from dovecot.ext import powerswitch
from dovecot.ext.toolbox import gfx
from dovecot.stemsim import stemcfg

if len(sys.argv) >= 2:
    uid = int(sys.argv[1])
else:
    uid = dovecot.stem_uid()

stem = stemcfg.stems[uid]
stem.cycle_usb()

ps = powerswitch.Eps4m(mac_address=stemcfg.stems[stem.uid].powerswitch_mac,
                       load_config=True)
ps_port = stemcfg.stems[stem.uid].powerswitch
if ps.is_off(ps_port):
    ps.set_on(ps_port)
    time.sleep(1)
while ps.is_restarting(ps_port):
    time.sleep(1)

ms = MotorSet(serial_id=stem.serial_id,
              motor_range=stem.motorid_range,
              verbose=True)
#ms.zero_pose    = stem.zero_pose
#ms.angle_ranges = stem.angle_ranges


def observe_max_angles():