Hello! I'm working on a project where I want my servos opened and closed once certain float integers occur in MAX Msp via a hand tracking device. I will be sending the data through to Arduino via a serial command. I have servos in pins 9, 10 and 11, which I would like to open at <-0.1, >-0.1 - <0.1, >0.1 respectively. Is there a way to say something such as, if x integer is sent, servo in x pin opens? I already have code to move the servo as desired, but I am lacking the command to say when to do it. Apologies for my lack of knowledge! Grateful for any advice
Float integers is an oxymoron. The variable is either float or integer. It sounds like you need float (has decimal places)
If you are sending data via serial then you will need to learn the serial read commands and how to convert the character data to float.
I don;t understand the part about when, the when is when you send the command.
Your best bet is to do as the pinned post re How to get the best from the forum states.
Provide a picture of a hand drawn and labeled wiring diagram and after you do a Tools/Auto Format post the code in code tags. Then we will likely understand more.
I see! Thankyou!
In regards to the when part, right now my servo will continuously move, but I need it to move only when the correct float occurs, but I'm still learning how to send that command. I've been looking into serial read commands so it's good to know I'm in the right place! Appreciate your help!
You are combining a few steps and taking a high level view.
The code will take smaller steps.
if a number is received
if it is less than x
move servo 1
if it is between y and z
move servo 2
and so forth. Little steps, none of which have the least idea of a concept of to what it is they contribute.
You might start with the reception:
HTH
a7
Perfect! I will have a look, thank you
That's really helpful, thank you!

