If I want to run 2 different programs simultaneously, can I do this with 2 arduinos wired together?

Context: I’m building a robot that will balance with reaction wheels while doing other tasks. I would like to have the balancing program running continuously in the background while the servos that control the robot are moving. Can I accomplish this by having a 2nd arduino running the balancing while the 1st arduino controls the rest of the robot?

  • 1
    yes, yes, and yes ..... good luck with your project
    – jsotola
    Jul 7 '21 at 3:11
  • You can go with Teensy 4.0 - it's so powerfull, it should be able to handle everything (if it's written correctly). Or maybe Raspberry pi pico with two cores - but I'm not sure if the Arduino core supports it (mbed might be: forum.arduino.cc/t/multicore-on-raspberry-pi-pico/858908/15 )
    – KIIV
    Jul 7 '21 at 7:08
  • 1
    Why do you think a single arduino is not enough to run a sketch with a combined program? You just need non-blocking code. Jul 7 '21 at 12:15

The answer is yes, you can run two programs one in each Arduino. There are no restrictions on doing this. There are probably millions of Arduinos currently operating without any interaction with each other. In your robot they would need some sort of communications between them. This is if there is to be any type of interaction between them. I do not know your skill set but it may be possibly do it with one with some tight code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.