class_ArduinoSerMntr.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Farmbot_GeneralAP 作者: SpongeYao 项目源码 文件源码
def connect_serial(self):
        if not(self.connect):
            try:
                for tmp_channel in self.channel:
                    try:
                        self.ser = Serial(tmp_channel, 115200, timeout=1) #FIXME, cha    nge device id to your system device
                        print tmp_channel,': connected successfully!'
                        self.connect= True
                        break
                    except:
                        print tmp_channel,': connection Refused!'
            except:
                print 'Connection of Arduino refused!'
                tkMessageBox.showerror("Error","Connection of Arduino refused!")
        else: 
            tkMessageBox.showerror("Error","Connection of Arduino is already built!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号