/RPI_drivers

Sample codes for driving different hardware with Raspberry Pi

Primary LanguagePython

RPI_drivers

Sample codes for driving different hardware with Raspberry Pi
The name of the original package is commu

Hardware

Raspberry Pi Zero Wireless

PCA9685 I2C 16 Channels PWM driver

MPU 9250 9 Axes Accelerometer

TCA9548A 8 Channels I2C Multiplexer

28015 REV C PING))) Ultrasonic Distance Sensor

Software

Raspberry Pi

Raspbian Jessie Lite
ROS packages:

  • rospy
  • roscpp
  • roslaunch
  • sensor_msgs
  • std_msgs
  • visualization_msgs
  • tf

PC

putty: https://www.putty.org/
Winscp: https://winscp.net/eng/index.php
Advanced IP Scanner: https://www.advanced-ip-scanner.com/
Win32DiskImager: https://sourceforge.net/projects/win32diskimager/

Relvant Links

Raspberry Pi headless setup: https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0
I2C setup: https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c

Relvant Issues

WIFI setup:

  • Add the following lines to /etc/wpa_supplicant/wpa_supplicant.conf:
network={
ssid="MySSID"
psk="MyPsk"
key_mgmt=WPA-PSK
}
  • Add the following lines to /etc/network/interfaces(for auto conntection, not default for Raspbian Stretch):
auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Show all connected I2C devices:

$ sudo i2cdetect -y

Make the scripts executable:

$ chmod +x something.py

Show ip address:

$ ifconfig

Install smbus2:

$ sudo apt-get install -y python2-pip
$ sudo pip install smbus2

To add new ros packages, follow the section 4.2 in this link:
http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Kinetic%20on%20the%20Raspberry%20Pi

GPIO for Raspberry pi 3 and pi zero w:
(Source page: http://www.raspberry-pi-geek.com/howto/GPIO-Pinout-Rasp-Pi-1-Model-B-Rasp-Pi-2-Model-B)
raspib-gpio_lightbox