-
Notifications
You must be signed in to change notification settings - Fork 227
Ch32v30x i2c test #793
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
base: master
Are you sure you want to change the base?
Ch32v30x i2c test #793
Conversation
|
Please reference the moved place for the i2c_lib.h, in that one example can reference another. |
| This example demonstrates I2C communication with an I2C slave device. | ||
| You can use this with (one or the other): | ||
| - BH1750 light sensor (actual hardware) | ||
| - Another CH32X035 running i2c_slave_test firmware |
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.
Is this correct? (This runs on a ch32v30x?)
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 only have the slave example working for Ch32x035, so technically, this code should be able to communicate with a Ch32x035 slave. I haven't test it with v30x.
| - BH1750 light sensor (actual hardware) | ||
| - Another CH32X035 running i2c_slave_test firmware | ||
|
|
||
| if you are connecting a CH32X03X to a BH1750, the default slave address for the sensor is 0x23 |
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.
Would really like a schematic.
| return raw * 12 / 10; // Convert to lux | ||
| } | ||
|
|
||
| void onHandle_ping(u8 i2cAddress) { |
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.
PLEASE stop using tight type specifiers. like u8 when it can just be an int.
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.
XD
|
My comments are in. Also if you can fix the compile. |
|
@unicab369 one of your other PRs conflicts with this one, can you fix the merge issue? |
|
@cnlohr ok, I will |
|
To be clear the issue is with uart_send_receive, you can do this by running |
|
oh I see. |
|
Mind fixing the conflict? If you can rebase off of |
No description provided.