-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fw 999 fw 103 hw kien nguyen #310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review comments. Ask questions in your onboarding thread!
projects/fw_103/src/ads1115.c
Outdated
|
||
StatusCode ads1115_read_raw(ADS1115_Config *config, ADS1115_Channel channel, int16_t *reading) { | ||
/* TODO: complete function */ | ||
i2c_read_reg(config->i2c_port, config->i2c_addr, ADS1115_REG_CONVERSION, (uint8_t *) reading, 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect read size. (16 bit read so it will be 2 bytes)
projects/fw_103/src/ads1115.c
Outdated
|
||
StatusCode ads1115_read_converted(ADS1115_Config *config, ADS1115_Channel channel, float *reading) { | ||
/* TODO: complete function */ | ||
uint16_t reader ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe if you pass in an int16_t instead of uint16_t, the value will be signed when returned. That way you won't need your check if (reader <= 32768). Just a simpler approach, don't need changes here. Everything else is good!
projects/fw_103/src/ads1115.c
Outdated
|
||
// Write Config register | ||
/* TODO: fill out this value */ | ||
cmd = 0x0011; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect CMD bitset. All bits in the config register should be default (Except for the conversion mode, which you will configure as continuous mode). The default bitset is 0000 0101 1000 0011, as per the datasheet.
3b34f21
to
9daae47
Compare
I have finished FW 103, can you help me look at it?