0% found this document useful (0 votes)
65 views

Physical Computing101: Part 3: Control of Mobile Robots: Hardware Lecture #7

This document discusses serial communication protocols for controlling mobile robots. It focuses on the BeagleBone Black and provides code examples for establishing serial communication between the BBB and an Arduino. Key topics covered include UART, I2C, and SPI serial buses, setting up the BBB for Python serial communication, using a logic level converter for serial communication between the BBB and Arduino, and sample Python code for writing "Hello from BBB!" to the serial port.

Uploaded by

yashar2500
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Physical Computing101: Part 3: Control of Mobile Robots: Hardware Lecture #7

This document discusses serial communication protocols for controlling mobile robots. It focuses on the BeagleBone Black and provides code examples for establishing serial communication between the BBB and an Arduino. Key topics covered include UART, I2C, and SPI serial buses, setting up the BBB for Python serial communication, using a logic level converter for serial communication between the BBB and Arduino, and sample Python code for writing "Hello from BBB!" to the serial port.

Uploaded by

yashar2500
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Physical Computing101: Part 3

Control of Mobile Robots: Hardware Lecture #7


Rowland OFlaherty
Robotics Ph.D. Candidate
Georgia Tech

Serial Communications

Serial (via UART)

2 wires:

Receive (Rx)

Transmit (Tx)

I2C

2 wires:

data (SDA)

clock (SCL)

SPI Bus

4 wires:

clock (SCLK)

master out slave in (MOSI)

master in slave out (MISO)

slave select (SS)

BBB Serial

Caution:

GPIO Pins operate at 3.3V

BBB Python Serial Setup



Use Adafruit tutorial to setup BBB for serial communication

http://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/overview


Overview

SSH into BBB

Install Python libraries
>>
>>
>>
>>

opkg update
opkg install python-pip python-setuptools python-smbus
pip install Adafruit_BBIO
pip install pyserial

BBB Serial Communication With Arduino


Logic level converter


BBB Serial Code



#!/usr/bin/python
import Adafruit_BBIO.UART as UART
import serial
UART.setup("UART4")
ser = serial.Serial(port = "/dev/ttyO4", baudrate=9600)
ser.close()
ser.open()
if ser.isOpen():
print "Serial is open!"
ser.write("Hello from BBB!\n")
ser.close()

>> minicom -b 9600 -D /dev/ttyO4

Demo

Final Words

Lets keeping the discussions going on 
Open roBotics (a.k.a OBotics)

New organization on GitHub:
https://github.com/o-botics

New website:
http://o-botics.org

You might also like