Arduino_MachineControl icon indicating copy to clipboard operation
Arduino_MachineControl copied to clipboard

API refactor

Open agdl opened this issue 4 years ago • 4 comments

Proposal for API refactor

agdl avatar Mar 25 '21 18:03 agdl

I strongly suggest to have just the object MachineControl for all the methods and align all the APIs to the one I proposed above. cc @pnndra @navalog @manchoz

agdl avatar Mar 25 '21 18:03 agdl

Some observations:

  • MachineControl.begin() to bring everything in a failsafe position should be implemented but cannot be made compulsory.
  • AnalogIn refactor looks ok, we just need to document it extensively (if there are no user tunables)
  • AnalogOut really depends on the user, so I'd merge the original sketch and the proposal like
  analog_out.write(0, 3.3);
  analog_out.write(1, 4.1);
  analog_out.write(2, 5);
  analog_out.write(3, 10.3);
  • DigitalOut: is setLatch the only way to use that channels?

Apart from this, I'd leave the names as written on the silk (so digital_outputs, although horrible, is better than DigitalOut)

Then, I have no clue about what kind of people will use this library, their level of expertise and their experience with Arduino (I think the latter won't be that high). Can we ask some of the early customers how they are feeling with the current API organization?

facchinm avatar Apr 01 '21 08:04 facchinm

we should ask to Rinaldi and all the customers whom Giacomo provided a PCM

Rocketct avatar Apr 01 '21 12:04 Rocketct

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar May 16 '21 07:05 CLAassistant