can I use the RX TX pins (0/1) to interface with my pi?

Hello, all. noob programmer here (atleast to arduino, my what a hybrid we have).

I just wanted to know if I could hook my pi up with 2 GPIO pins to my arduino 0/1 and start communicating via Cerial (my pi is hungry). If so, can someone point me to where I can learn the basics of a serial transmission so I can write a few pi-libraries, or maybe arduino libraries.

here is the basics of my code that I wish to use to communicate with my pi.
the first 2 characters in the serial transmission will be the command, ing this case, I only have ‘mq’ to change the marquee. The end of a transmission is signaled by sending another 2 character sequence ‘&E’.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 2, 3, 4, 5);//setup my humble LCD
String marquee = "this is a test marquee message. ";
char next = '1'; // used to buffer the Serial for somoth operation
long milliStart; // Is there anything bigger than long? does arduino have a bigInt datatype?
long idleOpMillis = 500;//the delay (ms) that the marquee will be updated
String serialGrab = "";// the whole serial string

void setup() {
  lcd.begin(16, 2);
  lcd.setCursor(0, 0);
  while(marquee.length() < 16){//making the marquee the appropriate length, so the scroll function works.
    marquee.concat(" ");

void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis()/1000);//I admit, I ripped this part directly off the liquidcrystal page.

  lcd.print(marquee);//slide the marquee over
  next = marquee.charAt(0);
  marquee = marquee.substring(1)+next;

  milliStart = millis();//start the clocks
  while((milliStart + idleOpMillis) > millis()){
    if(serialGrab.substring(serialGrab.length()-2) == "&E"){//test to see if the end transmission is recieved
      serialGrab = serialGrab.substring(0,serialGrab.length()-2);// chop off the '&E' portion
       if(serialGrab.substring(0,2) == "mq"){//check to see if it is the marquee command
       marquee = serialGrab.substring(2,serialGrab.length());
       Serial.print("mq");//success ping
       Serial.print("01"); //fail ping

void clrSerial(){
serialGrab = "";

thanks in advance, Tuskiomi

Since the RaspberryPi supports USB devices, why not just plug the Arduino's USB cable into the Pi and open the resulting USB serial port?

AFAIK the RPi runs at 3.3v and most Arduinos run at 5v so you would need circuitry to protect the Pi. The Arduino can probably read the 3.3v signal OK.

The examples in serial input basics may be of interest.


@2^ I had that idea yesterday. I'm heading to the pi forums to see what they have to say. @1^ thanks, i'll read throuh them!