Search found 3 matches

by analogdiode
Sat Oct 13, 2018 2:51 am
Forum: MicroPython pyboard
Topic: Writing to a local file is giving an error
Replies: 3
Views: 2431

Re: Writing to a local file is giving an error

Figured it out.... use of "pyb.usb_mode('VCP')" is required in boot.py, and after that to see the data collected you have to boot in safe mode. I was probably making some mistake trying to boot in safe mode.
by analogdiode
Fri Oct 12, 2018 11:25 pm
Forum: MicroPython pyboard
Topic: Writing to a local file is giving an error
Replies: 3
Views: 2431

Re: Writing to a local file is giving an error

I assume we want to add a try exception like so: <code> try: with open('dat.txt', 'a') as f: while c< 100: pyb.delay(100) f.write(str(c)+'\n') f.flush() c = c+1 f.close () except OSError as exc: print("Error is:" + exc) </code> I tried this two ways: (a) Name this file as main.py, and try to observe...
by analogdiode
Fri Oct 12, 2018 4:42 pm
Forum: MicroPython pyboard
Topic: Writing to a local file is giving an error
Replies: 3
Views: 2431

Writing to a local file is giving an error

Hello, I am trying to write to a local file every 100ms, and after the program has run I expect to see a txt file with numbers 0 through 99 in it. However, the text in the file stops at 5, and I cannot debug this. (The program given below is the minimum program that illustrates the issue, and my ove...