Search found 37 matches

by Iyassou
Sat Jul 02, 2016 8:29 pm
Forum: MicroPython pyboard
Topic: Setting the sys.stdout to a text file
Replies: 7
Views: 3743

Re: Setting the sys.stdout to a text file

No worries. I figured it out at the end. I'm sorry but I forgot to mention that the code was inside a file other than my main.py file, a sort of initialization file if you will. As a first fix-around I decided to open the file in both my main.py and initialization.py files, but that didn't work. The...
by Iyassou
Sat Jul 02, 2016 10:48 am
Forum: MicroPython pyboard
Topic: Setting the sys.stdout to a text file
Replies: 7
Views: 3743

Re: Setting the sys.stdout to a text file

My Pyboard has 48kb of flash which is why I'm using a 1GB SD card. Do I have to specify the output.txt file's location as being "/sd/output.txt"? When I got my Pyboard I wrote a small program that turned the LEDs on and off. Later when I needed to expand my storage, I backed up all of the files on m...
by Iyassou
Sat Jul 02, 2016 9:27 am
Forum: MicroPython pyboard
Topic: Setting the sys.stdout to a text file
Replies: 7
Views: 3743

Re: Setting the sys.stdout to a text file

Ok. I wrote: output = open("output.txt", "w") and replaced every print() statement with output.write() My program runs into OSError 22 at line 156 where I wrote: output.write("\n") I tried specifying that the newline is '\n' by writing: output = open("output.txt", "w", newline = '\n') but I got this...
by Iyassou
Sat Jul 02, 2016 7:42 am
Forum: MicroPython pyboard
Topic: Setting the sys.stdout to a text file
Replies: 7
Views: 3743

Setting the sys.stdout to a text file

Hello, the title is pretty straightforward, what I want to do is print matrices in a table format onto a text file. So far I've been printing them in a table format onto the REPL but now I want to have the Pyboard print the matrices onto a text file for logging/storing purposes. I imported the sys m...
by Iyassou
Thu Jun 30, 2016 5:45 pm
Forum: MicroPython pyboard
Topic: Installing NumPy on the Pyboard
Replies: 3
Views: 7044

Re: Installing NumPy on the Pyboard

Thanks for the clarification concerning microcontrollers and numpy. I ended up determining the matrix determinant expression by hand and ran it on my matrix (I'm handling a 4x4 matrix made up of 4 lists and no zeros in any of them) and it worked. It did take a while to find but at the end it's just ...
by Iyassou
Thu Jun 30, 2016 11:52 am
Forum: MicroPython pyboard
Topic: Installing NumPy on the Pyboard
Replies: 3
Views: 7044

Installing NumPy on the Pyboard

Hello,

I want to install Numpy on my Pyboard so that I can use the handy numpy.linalg.det() function to find a matrix determinant. I was wondering if this is possible and if it is how is it done.

Thanks.
by Iyassou
Tue Jun 28, 2016 8:29 am
Forum: General Discussion and Questions
Topic: MicroPython round() Function
Replies: 20
Views: 8233

Re: MicroPython round() Function

Hello, I imagine you've found this out by now but for anyone else asking the same question and reading this thread with a more recent version of MicroPython (mine is 3.4.0), the function is in the math module, syntax is: math.round(NumberToBeRounded, NumberOfDigitsAfterTheDecimalPointToBeRoundedTo) ...