My functions asks for 3 arguments. But its suppose to be only 2?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Marius
Posts: 21
Joined: Fri Nov 30, 2018 2:08 pm

My functions asks for 3 arguments. But its suppose to be only 2?

Post by Marius » Fri Oct 16, 2020 12:50 pm

What am i missing here?
code.png
code.png (25.04 KiB) Viewed 1792 times
function.png
function.png (29.06 KiB) Viewed 1792 times

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: My functions asks for 3 arguments. But its suppose to be only 2?

Post by pythoncoder » Fri Oct 16, 2020 1:19 pm

See the docs. The spi.write_readinto method takes two args, you provided only one.

Note that self counts as one arg, which is why the error message refers to 3 args. It is seeing self and ba so is getting 2 args instead of the required 3.
Peter Hinch
Index to my micropython libraries.

Marius
Posts: 21
Joined: Fri Nov 30, 2018 2:08 pm

Re: My functions asks for 3 arguments. But its suppose to be only 2?

Post by Marius » Fri Oct 16, 2020 1:54 pm

pythoncoder wrote:
Fri Oct 16, 2020 1:19 pm
See the docs. The spi.write_readinto method takes two args, you provided only one.

Note that self counts as one arg, which is why the error message refers to 3 args. It is seeing self and ba so is getting 2 args instead of the required 3.
Got it! Thanks! :D

Post Reply