我只想要函数的距离值

问题描述

我只想要函数的距离值,如果我打印working_odo,它将在while循环中带我开车。我只想要距离

def working_odo(): 
    last_state=IO.input(15)
    state_count=0
    while 1:
        current_state=IO.input(15)
        if(current_state!=last_state):
            state_count+=1
            #print(state_count)
            last_state=current_state
            distance = 0.001*state_count

这是编码器的覆盆子gpio代码

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)