microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
711 stars 586 forks source link

Serial data logging #3702

Open Jaqster opened 3 years ago

Jaqster commented 3 years ago

It would be nice if we could synchronize the time stamp when collecting serial data. Right now there are separate time stamps for each data point we collect: image

bsiever commented 3 years ago

@Jaqster For what it's worth, it looks like the time stamp is sent with each individual "write" (which is kind of sensible --- if they are combined and there are delays, you may have data associated with a time that isn't a very good fit).

But you can get one timestamp if you combine together messages into one write. Here's an example: https://makecode.microbit.org/_2mbVXpVzceTo EDIT: Whoops...ignore that. It does a single time stamp in the simulator, but not with a real microbit. (Is this related to when a buffer is flushed maybe?)