Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#!/usr/bin/env python3 # -*- coding: utf-8 -*-
"""Allows to remote control the LuckyLoop
args ----
host: str defaults to 127.0.0.1, but should be set in production to the ip-adress of the LuckyLoop device port: int defaults to 1219 because LuckyServer has the acronym LS and L is 12th character in alphabet and S is the 19th.
.. note::
For safety reasons, parameters like target frequency and phase are not set during initialization of the client, as this could interrupt an ongoing process on LuckyLoop when an user tries to reconnect. All parameters have be set explicitly after initialization.
Example -------
.. code-block:: python
luckyloop = LuckyClient() luckyloop.frequency = 20 sets the target frequency to 20 luckyloop.phase = 2 # sets the target phase to 2 luckyloop.trigger() # triggers immediatly
"""
"get the current phase set on LuckyLoop"
"""set the target_phase on LuckyLoop
args ---- target_phase an integer between 0 and 360° """
"threshold": "=", "target_phase": target_phase, "target_frequency": "=", "trigger": "=", }
"get the current threshold set on LuckyLoop"
"""set the target_phase on LuckyLoop
args ---- target_phase an integer between 0 and 360° """
"threshold": threshold, "target_phase": "=", "target_frequency": "=", "trigger": "=", }
"get the current frequency set on LuckyLoop"
"""set the target_frequency on LuckyLoop
LuckyLoop calculates phase and amplitude continually for a specific frequency. Change this target_frequency
args ---- target_frequency an integer of at least 1 Hz """
"threshold": "=", "target_phase": "=", "target_frequency": target_frequency, "trigger": "=", }
"""trigger LuckyLoop
Immediatly pulls the specified TRIGOUT to HIGH. LuckyLoop handles from then on, and by default it pulls it LOW after one cycle.
"""
"threshold": "=", "target_phase": "=", "target_frequency": "=", "trigger": 1, }
"shuts LuckyLoop down gracefully"
"enquire about the current status and version of LuckyLoop"
"send and receive a message to LuckyLoop"
"connect with LuckyLoop" "It is not possible to reach LuckyLoop. Restart the device and make sure that IP and port are correct." )
"close the connection to LuckyLoop" # self.socket.shutdown(1)
"serialize a status dictionary for sending" "ascii" )
"deserialize a message from LuckyServer and return it as a dictionary" |