Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
RPi_I2C
arduino
img
lsm303.calibration
node
pde
src
Easy.Electronics.8.fzz
PWM.md
README.md
ads1115.fzz
ads1115_bb.png
arduino.i2c.2.sh
arduino.i2c.sh
bme280.sh
bmp180.sh
bmp183.sh
build.gradle
connections.txt
continuous.sh
hat.2.stepper.sh
hat.stepper.sh
heelpitch.sh
hmc5883l.sh
htu21df.sh
inter.servo.sh
java.bmp
java.bmp.cpp
l3gd20.2.sh
l3gd20.gui.sh
l3gd20.sh
lsm303.gui.sh
lsm303.sh
matrix.01.txt
matrix.02.txt
mcp9808.sh
mearm.pilot.inter.sh
mearm.script.sh
mearm.sh
motor.test.sh
mpl115a2.sh
new.nmea.reader.sh
new.pure.nmea.reader.sh
nokia.lcd.2.sh
nokia.lcd.clock.sh
nokia.lcd.sh
pca9685.sh
rc.local
robot.test.sh
script.01.mearm
servo.001.sh
servo.002.sh
servo.003.sh
servo.inter.sh
servo.sh
ssd1306.sh
ssd1306_128x64.sh
ssd1306i2c.sh
ssd1306i2cDisplay.sh
standard.sh
tcs34725.main.sh
tcs34725.pwm.sh
tcs34725.sh
tsl2561.sh
vl53l0x.fzz
vl53l0x.sh
waveshare.2.sh
waveshare.3.sh
waveshare.sh
ws.servo.sh

README.md

I2C and SPI code and examples

Sensors

BME280, BMP180

I2C Pressure, Temperature, Humidity

BMP183

SPI Pressure, Temperature

HMC5883L

I2C 3 axis Compass

HTU21DF

I2C Humidity & Temperature

L3GD20

I2C Triple axis Gyroscope

LSM303

I2C Accelerometer + Magnetometer

There is this good paper about the LSM303 calibration. Run the i2c.sensor.LSM303 with -Dlsm303.log.for.calibration=true (see in the script lsm303.sh), this will generate a CSV log file you can use in a spreadsheet (like in the document above), to get the calibration offsets and coefficients.

Also see in the code (i2c.sensor.LSM303.java) how to apply those calibration parameters:

  sensor.setCalibrationValue(LSM303.MAG_X_OFFSET, 9);
  sensor.setCalibrationValue(LSM303.MAG_Y_OFFSET, -16);

Wiring

MPC9808

I2C Temperature

MPL115A2

I2C Pressure, Temperature

TCS34725

I2C Light sensor, color sensor

TSL2561

I2C Light Sensor

VCNL4000

I2C Proximity sensor

VL53L0X

I2C Time of Flight Distance

ADCs

ADS1x15

ADS1015 and ADS1115. I2C ADCs.

Document: ADC Benchmark.

Servos & Motors

PCA9685

I2C 16-channel 12-bit PWM/Servo driver. from Adafruit

About servo calibration, read this.

Adafruit Motor HAT

I2C, DC and Stepper Motors from Adafruit

Screens

SSD1306 (SPI and I2C)

128x32 and 128x64 OLED monochrome screens, https://www.adafruit.com/product/3527, https://www.adafruit.com/product/931, and https://www.adafruit.com/product/661, https://www.adafruit.com/product/326, https://www.adafruit.com/product/938.

Nokia5110

SPI 84x48 Monochrome LCD. https://www.adafruit.com/product/338

Waveshare 240x240, 1.3inch IPS LCD display HAT for Raspberry Pi

240x240 Color screen, with 3 buttons and a 5-option joystick, https://www.waveshare.com/product/modules/oleds-lcds/raspberry-pi-lcd/1.3inch-lcd-hat.htm, same size as the Raspberry Pi Zero.

Grahical display
Graphical Display
BMP Image
BMP Image
Gif image
Gif image
Keys and Joystick
Keys and Joystick listeners
Character data
Character data
Analog watch
Analog watch

Through the Java ImageIO package, all image formats are supported.

See the code here.

Miscellaneous

I2C communication between Raspberry Pi and Arduino. Package i2c.comm.

Examples

MeArm

Requires a PCA9685, and 4 servos.

See i2c.samples.MeArmScriptDemo and the script mearm.script, along with the file script.01.mearm.

See here for wiring and more details.

... More details to come.

You can’t perform that action at this time.