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.
Is this correct? (This runs on a ch32v30x?)
There was a problem hiding this comment.
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 |
| return raw * 12 / 10; // Convert to lux | ||
| } | ||
|
|
||
| void onHandle_ping(u8 i2cAddress) { |
There was a problem hiding this comment.
PLEASE stop using tight type specifiers. like u8 when it can just be an int.
|
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 |
|
Rebase is still pending |
|
@unicab369 please rebase this. I'd love it. |
|
@cnlohr I don't see this conflict on my local branch. I dont understand what's wrong. |
|
@unicab369 can you...
|
No description provided.