Serial input from CircuitPython

2 vues (au cours des 30 derniers jours)
Fabian Leede
Fabian Leede le 2 Déc 2019
Hi All,
A weird combination, I know. But I have a Adafruit ItsyBitsy M4 running on CricuitPython with a connected 9DOF sensor. The Itsybitsy spews out the 9DOF data in a list form on the serial port. I got matlab to read the serial port. But matlab reads it as plain text or random numbers. How can I read it as a list so that I can further use it?
Thanks in advance!
Schermafbeelding 2019-12-02 om 20.18.57.png
clc
clear all
s = serialport("/dev/cu.usbmodem14201",115200);
configureTerminator(s,"CR");
tic
n = 1;
while toc<1 %Loop when Plot is Active
data(:,n) = read(s,6,'double');
datab(n) = readline(s);
n = n+1;
end

Réponses (0)

Catégories

En savoir plus sur Performance and Memory dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by