I am working on a fairly large model commission at the moment and need to be able to control aspects of the model using servos and motors. The model is of a submarine, the control surfaces are going to be movable, periscope operable and the propeller is to turn.
My current thought is to use a couple of Nano Every. Being able to control multiple actions at the same time would be the final goal if at all possible For the first nano every: Each of the 2 periscopes have there doors opened by a servo and a motor to raise and lower it. There is a micro switch at either end of each periscope (4 switches total), this is where the interrupts come from. The periscopes take some time to raise and lower, and being able to set the other periscope in motion and/or control the control surfaces instead of having to wait around polling the input that the appropriate pin would not be ideal. The control surfaces are controlled by 3 other servos. The final aspect for this nano is to control the speed and direction of the propeller. I have an bundle of l293ds' here and plan to use one for the propeller, 2 direction lines and a PWM going to the enable of the L293D To reduce the amount of wiring going to and from the model itself its seemed to me to be a better idea to send data of I2C (or serial maybe - both seem about equal here). So the the user input will be another nano every or plain nano.
The second nano/nano every: This is going to deal with the user input and storing anything that needs to be stored. 3 variable resistors to control the control surfaces, a button for each of the 2 periscopes and a variable resistor and button to control the propeller. It will also have an LDR and some RGB LEDs (WS2812?) the will change depending on the light levels of the room where the model is. Due to the face that this nano will only be looking for input and then sending it to the other nano, polling each of the analogue and digital inputs should be fine
Hopefully that gives a fairly good outline of what I would like to achieve. A few questions: Will enabling and disabling each of the needed/un-needed interrupts for the periscope end stops cause issues? Or would checking switch stats in a similar fashion to blink without delay be better? Are there any known issues with using the servo library with PWM on the Nano Every? (I am yet to dig into the information surrounding the servo library, as I am aware that servos use PWM signals) If there is an issue, could I hijack a servo signal to control the motor speed as the library supports up to 12 servos IIRC?
The model is going to be 3'7" long and encased in wood and glass.