Matrix (with numpy)

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
mschulz
Posts: 35
Joined: Fri Apr 17, 2015 11:26 am
Location: Germany

Matrix (with numpy)

Post by mschulz » Thu Jun 11, 2015 8:25 am

Hello
I want to write the values of 8 ADC continuously into a Puffer.

So I want to use a Matrix for the values

http://stackoverflow.com/questions/6667 ... -in-python

Code: Select all

import numpy
buf2= numpy.zeros((5, 5))
print(buf2)
buf2[1][1]=1,1111
print(buf2)
But I get the error that there is no module named numpy

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

Re: Matrix (with numpy)

Post by pythoncoder » Thu Jun 11, 2015 8:47 am

Peter Hinch
Index to my micropython libraries.

mschulz
Posts: 35
Joined: Fri Apr 17, 2015 11:26 am
Location: Germany

Re: Matrix (with numpy)

Post by mschulz » Thu Jun 11, 2015 8:54 am

Ok, I know that MicroPython does not support all librarys.
But I hope there is an way to use nympy or somthing else to create a matrix?

You have a good Idea to solve the problem?

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Matrix (with numpy)

Post by SpotlightKid » Thu Jun 11, 2015 12:11 pm

Just use a list, a bytearray or an array.array.

mschulz
Posts: 35
Joined: Fri Apr 17, 2015 11:26 am
Location: Germany

Re: Matrix (with numpy)

Post by mschulz » Thu Jun 11, 2015 12:26 pm

Thank you, I now use a array.array.

Post Reply