Data log as a file in STM32 Nucleo-F767ZI

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
mironk
Posts: 11
Joined: Sun Jan 26, 2020 10:27 pm

Data log as a file in STM32 Nucleo-F767ZI

Post by mironk » Mon Jun 28, 2021 12:56 pm

I am trying to save as a file ADC data on STM32 Nucleo-767ZI board.
The script is as bellow:

Code: Select all

from pyb import Pin, ADC
import time
f = open('datafile.txt', 'a')
adc = ADC(Pin('A1'))
for i in range(0,100):
    tm1 = pyb.millis()
    sample = adc.read()
    if sample > 100:
        f.write(str(tm1) + "," + str(sample) +'\n')
f.close()
How can I extract the data as a file from nucleo board?
Last edited by mironk on Tue Jun 29, 2021 9:35 am, edited 1 time in total.

mironk
Posts: 11
Joined: Sun Jan 26, 2020 10:27 pm

Re: Data log as a file in STM32 Nucleo-F767ZI

Post by mironk » Mon Jun 28, 2021 5:19 pm

I found the solution. The data stored in memory are available on the second USB, but the ST-Link programmer USB has to be powered.

Post Reply