Skip to content
This repository has been archived by the owner on Dec 31, 2018. It is now read-only.

:AVxxxxx# command interpreter enhancement #3

Open
marcocipriani01 opened this issue Apr 1, 2018 · 0 comments
Open

:AVxxxxx# command interpreter enhancement #3

marcocipriani01 opened this issue Apr 1, 2018 · 0 comments

Comments

@marcocipriani01
Copy link
Owner

Line 147→157:

// Set the value of a pin
if ((line[0] == 'A') && (line[1] == 'V')) {
  String pin = "";
  pin.concat(line[2]);
  pin.concat(line[3]);
  String value = "";
  value.concat(line[4]);
  value.concat(line[5]);
  value.concat(line[6]);
  analogWrite(pin.toInt(), value.toInt());
}

Should be modified to be similar to all the other commands interpretation. For example:

if (!strcasecmp(cmd, "AV")) {
  ...
  analogWrite(pin, value);
}

Just because string.concat(line[4]).concat(line[5])... is ugly

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

No branches or pull requests

1 participant