Compatible Arrays

Hello everyone,

I'm a student and I'm working on Arduino for the first time.
I'm working on a real-time motion recognition project and I wanted to use an Arduino board for it.

I've already managed to do the code on my computer in Python coding language, and it basically only works comparing arrays containing data from accelerometers.

I wanted to try and use an Arduino board to have real-time data from and accelerometer, and do motion recognition in real time.
I would like to have my Arduino board and accelerometer to give my computer a constant flow of arrays that the computer would then process according to the code I wrote.

I would like to know beforehand if it's doable. Can I ask an Arduino board to give the computer a flow of arrays, that would then launch a Python code.

The best thing would be to write the code on the Arduino, but can the Arduino make those kinds of calculations? (cross-correlation mainly)

Thanks for your time,

Matthieu.

You can't output "a stream of arrays". 1) Because an array alone is nothing more then multiple variables of the same type which you can index. In memory it's just a block. 2) Serial (what is usually used for communication with the PC because it's already there) just sends bytes of data as separate packages.

But you can send over multiple bytes and separate different values with a known separator. For example, send over the values in a ascii representation and separate them with a comma or something.

See Robin2's Serial Input Basics Updated tutorial about it :slight_smile: Although that's mainly the other way around be the principle is the same :slight_smile:

Ok thanks I get it, I'll check the article! :wink:

Could you please tell me if it's possible to adapt my code inside the Arduino chip? Or is there something I can plug on the the chip to make it a bit more powerful in order to run the program?

I have understood Arduino isn't used for calculations, but rather to command external devices. Is it true?

Thanks,

Matthieu

Damn forum!! Since the update the crap is full of bugs. Disappearing usernames, opening "start a new thread" when I post an answer (that is now gone)...

What I (kind of) said, it's true a bit. An Arduino is not as powerful as your desktop Intel i7 but an Uno can do a lot of comparisons and additions in a second. But if you let it do float multiplication it's not very fast no. But the more complex Arduino's (or third party Arduino compatible micro controllers like the STM32 and ESP8266) are also faster. (And even come with hardware float (multiplication) hardware which can do it a heck lot faster. But I don't know if the IDE uses that.)

But no, an Arduino isn't only to command external devices. You can do pretty neat things with just an Arduino without an external "number crusher".