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

How can i connect the two units by I2C? #331

Open
2 tasks done
Mbincao opened this issue Dec 6, 2024 · 15 comments
Open
2 tasks done

How can i connect the two units by I2C? #331

Mbincao opened this issue Dec 6, 2024 · 15 comments

Comments

@Mbincao
Copy link

Mbincao commented Dec 6, 2024

Describe the bug

only one can work,

To reproduce

7db1b98a1f71f03cb2556a889219c1ca.mp4

Expected behavior

image

Screenshots

No response

Environment

  • OS:
  • IDE &IDE Version:
  • Repository Version:

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • My report contains all necessary details
@Tinyu-Zhao
Copy link
Collaborator

joystick2.begin (&Wire,JOYSTICK2_ADDR, 2, 1) ;//portA 2,1 //portB 9,8 //portC 17,18

change to
joystick2.begin (&Wire1,JOYSTICK2_ADDR, 2, 1) ;//portA 2,1 //portB 9,8 //portC 17,18

@Mbincao
Copy link
Author

Mbincao commented Dec 6, 2024

but it still doesn't work,when i change to wire1,and the value of joysticks doesn't work
and then i put on the joysticks, the uart port detect
Uploading image.png…

@Tinyu-Zhao
Copy link
Collaborator

Can't see your picture
Try again without using the M5CoreS3 library.

@Mbincao
Copy link
Author

Mbincao commented Dec 6, 2024

I commented on these lines of code.the power of control.uart can get the value,but why the display can't
// //配置电源
// auto cfg = M5.config();
// // cfg.output_power = true;
// CoreS3.begin(cfg);
// CoreS3.Display.setTextSize(2);

@Tinyu-Zhao
Copy link
Collaborator

😂Is there a possibility that M5CoreS3 can control the screen? Of course it cannot be used as you commented.

@Tinyu-Zhao
Copy link
Collaborator

You are using I2C communication, why did UART suddenly appear?

@Mbincao
Copy link
Author

Mbincao commented Dec 6, 2024

oh,sorry,i use the Serial Port Debugging Assistant to see the result

@Tinyu-Zhao
Copy link
Collaborator

M5CoreS3 internally calls M5Unified, M5, and a series of initialization operations are performed when begin. A certain set of I2C may be enabled by default, causing conflicts. Therefore, you cannot use Wire and Wire1 at the same time after enabling M5.begin.

@Mbincao
Copy link
Author

Mbincao commented Dec 6, 2024

i mean when i didn't comment the code,it's value didn't change as i control the joysticks

@Tinyu-Zhao
Copy link
Collaborator

也许你可以尝试
sensor.begin (&Wire1,SCROLL_ADDR, 17, 18)
joystick2.begin (&wire,JOYSTICK2_ADDR, 2,1)

@Mbincao
Copy link
Author

Mbincao commented Dec 6, 2024

when you change another,the other doesn't work,it's so wired

@Tinyu-Zhao
Copy link
Collaborator

那是不是如果不使用M5CoreS3这个库,两个模块都可以用

@Mbincao
Copy link
Author

Mbincao commented Dec 7, 2024

可能是调用了这个显示屏的缘故,我注释了显示屏供电后串口就可以正确读取数据了

@Tinyu-Zhao
Copy link
Collaborator

Tinyu-Zhao commented Dec 10, 2024

显示屏用的是M5Unified, M5.Begin后 Wire1默认被使用, 所以你再用Wire1可能就会有问题了
image

@Mbincao
Copy link
Author

Mbincao commented Dec 17, 2024

主要想问问是传输数据有问题吗,具体该咋解决?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants