-1

So I'm making a Robot for my AP Comp Sci Class, and I'm borrowing an Arduino, as well as a Pi from the school. What I plan to do is have my Pi output from the normal GPIO pins and into the Arduino's digital inputs to "Tell" the Arduino what servos to run. The reason I'm doing it this way is so I don't have to screw with interfacing and all that crap. Is it safe for the Arduino? If so, what would I need for resistors and such?

4
  • Didn't you already ask this? Commented May 16, 2017 at 14:02
  • I was told to move it here instead of having it on Stackexchange Commented May 16, 2017 at 14:15
  • You will need to expand on "I don't have to screw with interfacing and all that crap", because you are trying to do exactly that. Commented May 16, 2017 at 14:37
  • I think he means communication protocols (which would be the sensible way to do things)... Commented May 16, 2017 at 15:12

1 Answer 1

0

I think you are talking about writing to a GPIO and that being received by the Arduino if so the Pi is 3.3v and the Arduino is 5V so you will need a "Level Shifter" to boost the voltage to 5V so the Arduino can read the signals.

Other than that there is no problem with doing what you are doing, apart from its a lazy solution and you won't score very highly. I know you don't want to mess with protocols but if you can use I2C from the Pi then use that to send messages to the Arduino. Your protocol could be as simple as 1 byte saying which pin you want to light up, you'll get better marks.

Edit

To use I2C is really quite simple because someone has done almost all the work for you in Wire.h, so just include that file and then to send a byteits simply a case of:

Wire.beginTransmission(device_address);
Wire.write(data_byte);
Wire.endTransmission();

Reading data sheets for devices makes it look a lot harder with all the transmission sequence diagrams, but you don't need to worry about that its all done for you. The hardest bit to remember is the pull up resistors on the data lines.

Have a look at these links for more information:

2
  • That was exactly what I was talking about, my one problem is that I have no clue about how to use I2C correctly (i find it Kinda confusing) Commented May 16, 2017 at 17:03
  • There is a little bit more to it than that but not much. Commented May 17, 2017 at 7:22

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.