Connecting BeagleBone Black with Arduino MEGA 2560

Hello guys,

I have recently bought an Arduino to play around. So far, it's been very straight forward. I have managed to get a motor running with this code:

int servopin = 30;
int pulse = 1500;


void setup() {
  // put your setup code here, to run once:
  pinMode(servopin, OUTPUT);
  Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(servopin, HIGH);
  delayMicroseconds(pulse);
  digitalWrite(servopin, LOW);
  delay(20);

}

I'm now trying to use a BeagleBone to run this code from it. My setup is connecting my computer to BeagleBone. My BeagleBone is connected to my Arduino with USB (printer).

I've tried searching around for solutions but haven't found a way to run my Arduino using BeagleBone. Does anyone have any suggestion in terms of how I can connect the 2 together?

Please provide a detailed description of what you mean by "trying to use a BeagleBone to run this code from it".

That statement really doesn't make sense because that code runs on the Arduino board. There is nothing in the code that would require a BeagleBone to be involved.

Since we often have our Arduino boards connected to our computers with a USB cable, it's easy to get the impression that the code is running on your computer and the Arduino is just handling the IO to the pins (I thought that when I got started with Arduino), but this is not so. The code is compiled on the computer, but then it's uploaded to your Arduino board and it runs there. The code will run on the Arduino board even if you disconnect it from the computer. It only needs power.

This is super helpful! What I was trying to accomplish was finding a way to run my Arduino by connecting it to a BeagleBone instead of a power supply. Turns out it works automatically once the code has been uploaded. So you don't need to do anythign except connect them together.

You saved me a lot of time!

You're welcome. I'm glad to hear it's working now.

The realization that the code was actually running independently on that tiny little chip on my Arduino board was a big revelation for me early on in my journey with Arduino. I already thought it Arduino was cool as a way to control things via my computer, but that made it vastly more cool to me.

Enjoy!
Per