Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct i2c null address error #3 #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/cyberpi/src/gyro/gyro.c
Original file line number Diff line number Diff line change
@@ -12,11 +12,6 @@ static float acc_y_static = 0.0;
static float acc_z_static = 0.0;
bool gyro_init()
{
uint8_t chip_id = i2c_read( MPU6887_ADDR, WHO_AM_I);
if(chip_id != MPU6887_DEVICE_ID)
{
return false;
}
data_buf = (uint8_t*)malloc(14);
acc_value = (int16_t*)malloc(6);
gyro_value = (int16_t*)malloc(6);
2 changes: 1 addition & 1 deletion lib/cyberpi/src/i2c/i2c.c
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ void i2c_init()
gpio_config(&io_conf);

int i2c_master_port = I2C_NUM_1;
i2c_config_t conf;
i2c_config_t conf = {0};
conf.mode = I2C_MODE_MASTER;
conf.sda_io_num = I2C_MASTER_SDA_IO;
conf.sda_pullup_en = 0;