generated from hulk/gd32e23x_template
change iic speed to 20K
This commit is contained in:
27
src/main.c
27
src/main.c
@@ -60,20 +60,23 @@ int main(void) {
|
||||
printf("\r\n");
|
||||
|
||||
delay_ms(500);
|
||||
ldc1612_iic_get_sensor_infomation();
|
||||
|
||||
uint16_t device_id = 0;
|
||||
device_id = ldc1612_get_deveice_id();
|
||||
printf("device id = 0x%x\r\n", device_id);
|
||||
|
||||
delay_ms(100);
|
||||
|
||||
device_id = 0;
|
||||
device_id = ldc1612_get_manufacturer_id();
|
||||
printf("device id = 0x%x\r\n", device_id);
|
||||
|
||||
uint8_t data[2] = {0x05, 0x36};
|
||||
ldc1612_iic_write_16bits(SET_CONVERSION_TIME_REG_START, data);
|
||||
// uint16_t device_id = 0;
|
||||
// device_id = ldc1612_get_deveice_id();
|
||||
// printf("device id = 0x%x\r\n", device_id);
|
||||
//
|
||||
// delay_ms(100);
|
||||
//
|
||||
// device_id = 0;
|
||||
// device_id = ldc1612_get_manufacturer_id();
|
||||
// printf("device id = 0x%x\r\n", device_id);
|
||||
|
||||
uint16_t result = {0x0546};
|
||||
uint8_t data[2] = {0};
|
||||
data[0] = (result >> 8) & 0xFF;
|
||||
data[1] = result & 0xFF;
|
||||
printf("data[0] = 0x%x, data[1] = 0x%x\r\n", data[0], data[1]);
|
||||
|
||||
while (1) {
|
||||
// delay_ms(1000);
|
||||
|
Reference in New Issue
Block a user