Control Robot with Max

fernicolosi's icon

Hi there!

For a project that I'm currently working on I'm trying to get a robot move on 2 wheels... each wheel are attached separately to two different motors which I'm controlling through Arduino. So far this is what I got: Through serial communication I can send the commands to my Arduino board, I'm using a [KEY] object on Max to do so. With the arrows of the keyboard I can make the robot go North-East-South-West (with the four arrow keys).

Now, I want to get Northeast-Southeast-Northwest-Southwest as well... I can't figure it out how to make it with the Key object to detect when two arrows keys are pressed at the same time. I don't want to stop the robot moving for changing directions but to be able to change it as it's moving...

Some clues over there how to make this work??

(I hope the idea is clear!)

Thanks,
Fer

Nat's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here's one way to do it, did it only for North west but you get the idea:

fernicolosi's icon

Hi Nat! Thanks a lot for the help. I managed to reach what I went through that way! Super ^^

Gracias!

Fer

ps. Is the Toolboox still working on Max 6?? I've been trying to make it work but yet with no luck... I followed instructions but shortcuts don't respond and also I cannot make the Shell (Shift+r) window appear on my max.

vichug's icon

(hey, here i'm working without problem with that dear ToolBox on latest max614,32bitsOSX1068. though, it should be noted that toolbox won't work in helpfiles, because there are incompatible js scripts apparently. I can make shell appear too.)

fernicolosi's icon

Looks weird as I can't either open the Shell window with the Shift+R keys... I found some external Shell object but it seems that it won't perform the same way as doing it from the shell window. In the other hand can't make it work with shortcuts either, maybe I'm just doing it in the wrong way... Any clue??

I'm running Max 6.0.4 on a OSX 10.7.5

Thanks for the help!
Fer

Nat's icon

It should work fine in max 6. When you open max do you see a toolbox message in the max window ? What version is installed ?

fernicolosi's icon

Hi Nat! My Max is a 6.0.4 running on a OSX 10.7.5 MacBook Pro computer... and the ToolBox version is the "maxtoolbox_14_max5" recently downloaded from your site.

It's possible to find the Toolbox from the extras menu on Max which I've already Activated... but when trying to use the shortcuts it's not working and as I said it's also not possible to launch shell window when pressing Shift+R.

Perhaps I'm trying to use the shortcuts in the wrong way?? Is it just like choosing the object and hold the shortcuts keys to the other?? I've tried in many different ways to make the connection but not finding the way yet!

Thanks a lot again for the information!

Fer

Nat's icon

Can you try removing completely and try this version ?
https://github.com/natcl/maxtoolbox/archive/Version15.zip

fernicolosi's icon

Perfectly working now! Thanks a lot man, this really makes difference at the moment of patching ^^

Thanks for the support, now is time for easy patching!

Fer