在PYB nano上为什么不能搜索到DAC函数

STM32系列
pyboard相关
回复
Vuko
帖子: 2
注册时间: 2019年 11月 20日 20:05

在PYB nano上为什么不能搜索到DAC函数

#1

帖子 Vuko »

这里我用的版本是这样的:
MicroPython v1.10 on 2019-01-26; PYB Nano V2 with STM32F411CE
Type "help()" for more information.

然后我help了后有发现DAC的部分
Welcome to MicroPython!

For online help please visit http://micropython.org/help/.

Quick overview of commands for the board:
  pyb.info()    -- print some general information
  pyb.delay(n)  -- wait for n milliseconds
  pyb.millis()  -- get number of milliseconds since hard reset
  pyb.Switch()  -- create a switch object
                   Switch methods: (), callback(f)
  pyb.LED(n)    -- create an LED object for LED n (n=1,2,3,4)
                   LED methods: on(), off(), toggle(), intensity(<n>)
  pyb.Pin(pin)  -- get a pin, eg pyb.Pin('X1')
  pyb.Pin(pin, m, [p]) -- get a pin and configure it for IO mode m, pull mode p
                   Pin methods: init(..), value([v]), high(), low()
  pyb.ExtInt(pin, m, p, callback) -- create an external interrupt object
  pyb.ADC(pin)  -- make an analog object from a pin
                   ADC methods: read(), read_timed(buf, freq)
  pyb.DAC(port) -- make a DAC object
                   DAC methods: triangle(freq), write(n), write_timed(buf, freq)
  pyb.RTC()     -- make an RTC object; methods: datetime([val])
  pyb.rng()     -- get a 30-bit hardware random number
  pyb.Servo(n)  -- create Servo object for servo n (n=1,2,3,4)
                   Servo methods: calibration(..), angle([x, [t]]), speed([x, [t]])
  pyb.Accel()   -- create an Accelerometer object
                   Accelerometer methods: x(), y(), z(), tilt(), filtered_xyz()

Pins are numbered X1-X12, X17-X22, Y1-Y12, or by their MCU name
Pin IO modes are: pyb.Pin.IN, pyb.Pin.OUT_PP, pyb.Pin.OUT_OD
Pin pull modes are: pyb.Pin.PULL_NONE, pyb.Pin.PULL_UP, pyb.Pin.PULL_DOWN
Additional serial bus objects: pyb.I2C(n), pyb.SPI(n), pyb.UART(n)

Control commands:
  CTRL-A        -- on a blank line, enter raw REPL mode
  CTRL-B        -- on a blank line, enter normal REPL mode
  CTRL-C        -- interrupt a running program
  CTRL-D        -- on a blank line, do a soft reset of the board
  CTRL-E        -- on a blank line, enter paste mode

For further help on a specific object, type help(obj)
For a list of available modules, type help('modules')



但是我进行help(pyb.DAC)D的时候就会出现这样的情况:

>>> help(pyb.DAC)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'DAC'

无法调用,请大佬给我解答下,这个到底是什么原因?

头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

Re: 在PYB nano上为什么不能搜索到DAC函数

#2

帖子 shaoziyang »

pyb nano使用的是STM32F411,它没有DAC功能。

pybCN使用的是STM32F405,这个芯片才支持DAC。另外社区的pybL(低功耗系列),也是支持DAC的。

Vuko
帖子: 2
注册时间: 2019年 11月 20日 20:05

Re: 在PYB nano上为什么不能搜索到DAC函数

#3

帖子 Vuko »

才入坑菜鸡一枚,好的谢谢大佬啦

回复

  • 随机主题
    回复总数
    阅读次数
    最新文章