tomstewart89 / BasicLinearAlgebra

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

No loop? #11

Closed Cabzx closed 7 years ago

Cabzx commented 7 years ago

Hey guys,

I am trying to get the matrix to work inside loops, but it won't comply. I am using the HowToUse example but I am adding "x;" to the loop.

Arduino: 1.8.3 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

HowToUse.ino: In function 'void loop()':

HowToUse:112: error: 'x' was not declared in this scope

 void loop() { x; }

               ^

exit status 1
'x' was not declared in this scope
Cabzx commented 7 years ago

It seems that matrix declarations inside setup aren't read by the loop function. Just placing all matrix declarations as globals seems to have fixed the issue.