Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Feature Request] GPIO support in MeshCore

Đang mở
#3,522 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
cli, embedded-iot

Hướng nghiên cứu

Start by reading src/MeshCore.h, especially the existing MainBoard GPIO methods, then trace the common CLI and board subclasses for the roles and board types mentioned in the proposal. The issue proposes GPIO defines, analog and digital access, and new CLI commands, but leaves compatibility and implementation details open; done would mean agreeing on the interface and supporting the requested pin operations across board roles.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I need to access GPIO pins on my meshcore nodes. I guess that this is something that others also want, and I can write an implementation of this if the proposal is acceptable. The idea is that we expose new CLI commands that lets you set/retieve the values of a GPIO-pin. This is something that I want to implement on all roles.

I want to make some new defines:

GPIO_IN
GPIO_OUT
GPIO_DAC
GPIO_ADC

These defines is a comma-separated list of GPIO-pins that is accessible using the CLI. If a define is not present, then there will be no corresponding GPIO for that type.

Then I want to extend mesh::MainBoard in src/MeshCore.h with some new member functions. These should be overridden at the board type (ESP32 etc).

class MainBoard {
    public:
    virtual bool setGPIO(int pin, bool newState) = 0; // returns true if the pin was set
    virtual bool setDAC(int pin, float value) = 0; // returns true if the pin was set
    virtual bool getGPIO(int pin); // return the value, or false if the pin does not exist
    virutal float getADC(int pin); // returns the value, or 0
}

I know that getGpio() and setGpio() is defined in MainBoard already, and probably it would be a good idea to use them. I just don't know the consequence yet of using these.

I have not a GPIO-init function here. I think that can be handled by the MainBoard subclass own setup/begin() function.

Then change the common CLI, add some new commands.

set gpio 1 1
get gpio 1
set gpio 2 3.43

If the GPIO is analog, use float values, for digital use 0 or 1.

Any thoughts?

Ngôn ngữ chính
C
Star
3.9k
Fork
1.5k
Merge trung bình
19 giờ 9 phút
Pull request đã merge (30 ngày)
27

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của meshcore-dev/MeshCore

Tất cả issue của meshcore-dev/MeshCore

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.