Hi,
I have a question.
How can I know an instance is necessary to work module?
For example,
pyb.Pin.board.LED.on()
This will work without an instance.
However,
pyb.RTC.datetime()
This dose not work.
rtc = pyb.RTC()
rtc.datetime()
This works.
I can imagine that this difference depends on how to make a module.
How people who do not see the source of the module can find this diffrence?
How can I know an instance is necessary to work module?
Re: How can I know an instance is necessary to work module?
We read the documentation.
Re: How can I know an instance is necessary to work module?
Thank you, for your ans.
I have known pyb.RTC() sample code in documents.
However, there are many module functions without sample code in documents.
I felt uneasy and asked a question.
I have known pyb.RTC() sample code in documents.
However, there are many module functions without sample code in documents.
I felt uneasy and asked a question.
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: How can I know an instance is necessary to work module?
If you ask about a module without documentation, you might get an answer. But theser are documented.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode