tomstewart89 / BasicLinearAlgebra

A library for using matrices and linear algebra on Arduino
MIT License
187 stars 38 forks source link

Something weird is happening when I want to display the Matrix data #28

Closed ripponds closed 3 years ago

ripponds commented 3 years ago

Hi Tom,

I want to send data via serial communication, as you can see in the picture. If I write a random float numbers instead "PV(1,1)" and "PV(2,1)" the numbers are displayed in Simulink without problem. So, sending data it's not the problem.

I was testing how to send matrix values created with your library. The strange thing happened when I wanted to send "PV(1,1)" and "PV(2,1)", It was declared like this "BLA::Matrix<2,1> PV;" then in the loop, I filled the matrix "PV" as shown in the picture. The code compiled without errors so , when I went To simulink, It displayed the values of "SEPO"... I tested with "Monitor Serie" in Arduino and the same problem.

I also tested sending "SEPO" values and Simulink displayed "nan, nan"

Finally I created a new matrix "e" and I assigned values after "PV" as shown in the second picture. Simulink displayed now "PV" values...

IDK what's wrong, its my first time using your powerfull library, but I don't know if I skipped a step or what happen :(

Kind regards from Colombia :D

GitHub GitHub2

tomstewart89 commented 3 years ago

Hey @ripponds , sorry it took me a while to get back to you here. I'm not really sure what the problem might be but do you think you could share a minimal example that I can run and see nan values being printed to the arduino serial monitor?

tomstewart89 commented 3 years ago

I'm going to close this guy since it's been inactive for a while now. @ripponds if you're still having trouble feel free to re-open!