12.11

作者: 王春雪cs | 来源:发表于2017-12-11 20:12 被阅读0次

    今天老师讲了定时器Timer AD转换和DA转化

    import micropython.                                                micropython.alloc_emergency_exception_buf(100)  这个中断中必须要留下的空间  程序中依然放在首位             

        tim.counter()括号中无参数时取记数值 有参数表示设置记数值

        tim.freq(0.5)有参数代表设置的频率是0.5hz

        tim.callback()回调

      tim.deinit()取消定时器 tim.period无参取周期 有参设置周期tim.prescaler无参取分频系数有参设置分频系数tim.source_freq无参取原频率有参设置原频率

      ch=tim.channel(channel,mode,pin,pulse_width)定时器分配给某个通道

      val=adc.read()0-4095.    adc=ADC(‘x19‘)设置引脚 dac=DAC(1)1表示x5引脚2表示x6引脚

    相关文章

      网友评论

          本文标题:12.11

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