Link Search Menu Expand Document

Raspberry Pi

GPIO

Pinout on Raspberry 1 model B rev 2 and following are the same, save for the fewer pins.

I2C Development

I2C introduction

Setup

  1. Activate I2C in raspi-config
  2. Install sudo apt install i2c-tools and add current user to i2c group sudo adduser $USER i2c
  3. Reboot
  4. Test if I2C device is found sudo i2cdetect -y 1

Source

Usage

  • Programming I2C with Python
  • Use hexadecimal (start with 0xF) or binary (0b1111)
  • Setup
    1. sudo apt install python3-pip python3-smbus
    2. pip3 install smbus2
    3. Then usage:

       from smbus2 import SMBus
       i2c_bus = SMBus(1)  # Create a new I2C bus on bus 1
       data_read = i2c_bus.read_i2c_block_data(I2C_ADDR, 0x0, 1)
       i2c_bus.write_i2c_block_data(I2C_ADDR, 0x0 , I2C_COMMAND)
      
  • Documentation:

Network

USB WLAN / Wi-Fi network interface

  • The EW-7811Un 802.11n Wireless Adapter is a Realtek RTL8188CUS

SD Card

  • Migrate to smaller SD Card
    1. Backup
    2. Use a Linux host to resize the partition
    3. Make an image and restore it to target SD