More test results:
Remove “3-axis Acceleration” and “Air Pressure” modules from the Grover Beginner Kit board.
Connect I2C cables for both modules.
No problems with test program, at the end of this note. (Combination of the OLED, motion, and pressure lessons.)
However, if you don’t connect the removed modules, the OLED will not work.
Why? On the OLED module, SDA and SCL have 10K pullup resistors to Vcc.
Need lower value pullups.
Solution: Add 4.7K resistors from SDA to Vcc and SCL to Vcc on an IIC connector.
Can someone at Seeed Studio verify my result?
What to do for people who have purchased these boards?
Those who have the old board: Provide a 3-axis acceleration module that fixes the 3.3v problem.
(Perhaps the Grove - 3-Axis Digital Accelerometer (LIS3DHTR) SKU 114020121) works with the beginner kit?)
(My students are not able to solder the rework wire. And, I can’t do it for them as our classes are remote.)
For all customers: Provide a Grove connector that includes 4.7K pullup resistors for SCL and SDA.
(Perhaps a modification to the Grove - I2C Hub (6 Port) SKU 103020272? Add pull-up resistors?)
I teach at two different schools. We would need to contact the people who purchased the beginner kits to determine what needs to be shipped where. (We can do this via email, not in the forum.)
Thanks,
Wayne
//Test I2C modules (OLED, pressure,accelerometer)
//OLED
#include <Arduino.h>
#include <U8x8lib.h>
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
//Accelerometer
#include "LIS3DHTR.h"
#include <Wire.h>
LIS3DHTR<TwoWire> LIS; //Hardware I2C
#define WIRE Wire
//pressure
#include "Seeed_BMP280.h"
BMP280 bmp280;
void setup(void) {
Serial.begin(9600);
//OLED
u8x8.begin();
u8x8.setPowerSave(0);
u8x8.setFlipMode(1);
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.clearDisplay();
u8x8.setCursor(0, 0);
u8x8.print("I2C module test");
//Accelerometer
Serial.println("LIS_accel init:");
LIS.begin(WIRE, 0x19); //IIC init
delay(50);
LIS.setOutputDataRate(LIS3DHTR_DATARATE_50HZ);
//pressure
Serial.println("bmp280_pressure init:");
if (!bmp280.init()) {
Serial.println("Device not connected or broken!");
u8x8.clearDisplay();
u8x8.setCursor(0, 0);
u8x8.print("bmp280 fail: ");
}
}
void loop(void) {
u8x8.clearDisplay();
u8x8.setCursor(0, 0);
u8x8.print("Accl: ");
u8x8.print(abs(LIS.getAccelerationX()) + abs(LIS.getAccelerationY()) + abs(LIS.getAccelerationZ()));
u8x8.setCursor(0, 1);
u8x8.print("Press: ");
u8x8.print(bmp280.getPressure());
u8x8.setCursor(0, 2);
u8x8.print("Temp: ");
u8x8.print(bmp280.getTemperature());
delay(100);
}