document commands

This commit is contained in:
Astro 2019-09-17 01:46:29 +02:00
parent 4c00548646
commit 393c276bda
2 changed files with 16 additions and 7 deletions

View File

@ -18,10 +18,17 @@ The scope of this setting is per TCP session.
### Commands
| Syntax | Function |
| --- | --- |
| `report` | Report mode: once |
| `report mode` | Show current report mode |
| `report mode <off or once or continuous>` | Set report mode |
| `pwm <width> <total>` | Set PWM duty cycle to width / total |
| Syntax | Function |
| --- | --- |
| `report` | Show current input |
| `report mode` | Show current report mode |
| `report mode <off or on>` | Set report mode |
| `pwm <width> <total>` | Set PWM duty cycle to width / total |
| `pid target <value>` | |
| `pid kp <value>` | |
| `pid ki <value>` | |
| `pid kd <value>` | |
| `pid output_min <value>` | |
| `pid output_max <value>` | |
| `pid integral_min <value>` | |
| `pid integral_max <value>` | |

View File

@ -146,6 +146,7 @@ fn report(input: &[u8]) -> IResult<&[u8], Command> {
)(input)
}
/// `pwm <width> <total>` - Set pwm duty cycle
fn pwm(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
let (input, _) = tag("pwm")(input)?;
let (input, _) = whitespace(input)?;
@ -182,6 +183,7 @@ fn pid_parameter(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
Ok((input, result))
}
/// `pid <parameter> <value>`
fn pid(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
let (input, _) = tag("pid")(input)?;
let (input, _) = whitespace(input)?;