This PR proposes providing support for both flavors of PWM control commands: step-based and direct value specification. We may want to switch between them for different products, so why not to keep both, if they are not in conflict with each other?
I'm also adding a test case. The test case is generic, meaning that it does not require ATTiny85 or Arduino, and could be deployed just on a regular laptop or desktop. The test has revealed that having serial.read() in the write value command is not a good idea. I don't know how SoftSerial implementation works, but in general doing serial.read() not prepended by serial.available() is UB. For this reason, I've changed the serial parsing code to handle the values separately.
Please let me know what you think. If looks good to you, please merge and make the testing scenario more meaningful. Ideally, we would want putCommands and getValues content to test thoroughly all commands that we support. Having such testing is a good sign for our customers, that we are serious about a good product development.
Hi @ognjenMarinkovic27 ,
This PR proposes providing support for both flavors of PWM control commands: step-based and direct value specification. We may want to switch between them for different products, so why not to keep both, if they are not in conflict with each other?
I'm also adding a test case. The test case is generic, meaning that it does not require ATTiny85 or Arduino, and could be deployed just on a regular laptop or desktop. The test has revealed that having
serial.read()
in the write value command is not a good idea. I don't know how SoftSerial implementation works, but in general doingserial.read()
not prepended byserial.available()
is UB. For this reason, I've changed the serial parsing code to handle the values separately.Please let me know what you think. If looks good to you, please merge and make the testing scenario more meaningful. Ideally, we would want
putCommands
andgetValues
content to test thoroughly all commands that we support. Having such testing is a good sign for our customers, that we are serious about a good product development.