12.10

作者: 李响lx | 来源:发表于2017-12-10 20:37 被阅读0次

    学习了重力加速  最后发现加速其实是板子与垂直方向的夹角

    from pyb import Accel,delay,Pin

    accel = Accel()

    p_out1 = Pin('X1', Pin.OUT_PP)

    while True:

    if accel.x()>0:

    p_out1.high()

    delay(20*accel.x())

    p_out1.low()

    delay(440-4*accel.x())

    else:

    p_out1.high()

    delay(-20*accel.x())

    p_out1.low()

    delay(440-4*accel.x())

    相关文章

      网友评论

          本文标题:12.10

          本文链接:https://www.haomeiwen.com/subject/qpnvixtx.html