tomstewart89 / BasicLinearAlgebra

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

Tabbed Function is not Working With the BLA #27

Closed grndctrl2majtom closed 3 years ago

grndctrl2majtom commented 3 years ago

I am trying to use a tabbed function to produce a matrix; however, it says it "was not declared in this scope" when I call it from the main loop. The function in question is HomogenousTransform and is being called in line 96. I feel like there is something small that is preventing this from working properly so I look forward to hearing your ideas.

What is odd is that the function runs when I define it after the setup (lines 59-68)

You can find my code here, let me know if you find the same issue https://github.com/grndctrl2majtom/ArduinoMatrixTrial

thomascent commented 3 years ago

Hey @grndctrl2majtom, thanks for opening an issue. I'm not really that familiar with using multiple .ino files in a project but based on this post it looks like the files in the other tabs are basically cut-and-pasted to the bottom of the main .ino file at compile time.

If that's the case you're getting that was not declared in this scope because you're trying to call the HomogenousTransform before it was declared (i.e at the bottom of the sketch).

To be honest if you want to organise your code you're probably better off just moving things into .h files and .cpp files like any other C++ project. Try following the instructions here and see how it goes.

grndctrl2majtom commented 3 years ago

So I just copied and pasted it into a new .ino and it works for some reason... I will never truly understand technology.