python接口到optotune焦距可调镜头

opto的Python项目详细描述


opto是一个python模块,允许您使用 这是Optotune Lens Driver 4。 用Optotune EL-10-30测试。

示例

打开串行端口,连接到光调谐,设置镜头电流 至50毫安,然后关闭串行端口,轻轻地将镜头恢复至0毫安 当前:

fromoptoimportOptoo=Opto(port='/dev/cu.usbmodem1411')o.connect()o.current(50.0)o.close(soft_close=True)

或者,这里我们使用with语句来创建正弦曲线 从最小电流到最大电流和反向的过渡:

fromoptoimportOptoimportnumpyasnpimporttimewithOpto(port='/dev/cu.usbmodem1411')aso:current_low=o.current_lower()current_high=o.current_upper()current_delta=current_high-current_lowforiinnp.linspace(0,2*np.pi,1000):o.current(np.sin(i)*current_delta+current_low)time.sleep(0.01)

安装

使用pip从github安装:

pip install git+https://github.com/OrganicIrradiation/opto.git

或者使用git克隆包:

git clone https://github.com/OrganicIrradiation/opto.git

要求

需要pySerial

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android将字符串拆分为数组   java如何读取底层HttpServerExchange对象中的响应数据?   在jenkins上安装gitplugin时出现java错误   java DecimalFormat格式decimal,用于保留可变数量的尾随零   java Jaxws、spring和SpringBeanAutowiringSupport   Gson中抽象类的java反序列化   监视Windows服务器中的UDP数据包丢失,Java   java从侦听器调用所有者类   java Scala和Robocode类循环错误   java映像未上载到数据库   java如何将XML文件直接写入zip存档?   java为什么需要EventSourcingHandler(在聚合对象中)?   接受特定对象或其子类型的java通用方法   java Spring安全过滤器映射在特定Url模式上禁用