[Grbl_Esp32 PR#417] Pin classes

未分类 bolang 4个月前 (10-14) 38次浏览

Issue #417 | 状态: 已关闭 | 作者: MitchBradley | 创建时间: 2020-06-02


This is a proof of concept to see what it would look like to use classes for pins.

This code is not working and is not fully elaborated. For now it is just to show how the common code would change.

To finish the code it would be necessary to create several arrays – motors[], limitSwitches[] etc that instantiate the pin objects listed in the machines files. In a future revision of this PR, I will show some interesting ways to do that. For now, just look at how the common code cleans up nicely.

I think that the base classes InPin and OutPin can be specialized for different expanders.

One thing that is not yet addressed is the need for pin attributes like open drain, pullups, and interrupt attributes. That too is a topic for a future revision.


评论 (1)

#1 – MitchBradley 于 2020-06-02

Another omission is the reimplementation of digitalWrite() to accommodate the TMCStepper library. Again, a topic for later.


原始Issue: https://github.com/bdring/Grbl_Esp32/pull/417

喜欢 (0)