Go Down

Topic: How to work with vectors (Read 488 times) previous topic - next topic

wulmbos

How to work with vectors in Arduino? Is there any working example?

AWOL

Do you mean one dimensional arrays, or magnitude and direction pairs?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

wulmbos

One dimensional arrays.

I would like something like this
Code: [Select]
array.add(5); //add new member
array.unset(4); //delete member with index 4



AWOL

Dynamic arrays on a RAM limited processor are not a great idea.
What are you trying to do?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

wulmbos

It's hard to explain. I can done done it with regular arrays, but it would be much easier with vectors. Is it good idea to build my own class?

AWOL

It may be possible to use STL, but I've never tried it on an Arduino.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

robtillaart

NIck Gammon has notes about STL on AVR/Arduino - http://www.gammon.com.au/forum/?id=11119 -

Where would we be without him ;)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up