Skip to content

Commit

Permalink
Fix examples in analogin docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xs5871 committed Dec 16, 2024
1 parent 4ecd7aa commit 5f1c856
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/en/analogin.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ value in the domain [0, 65535].
```python
from kmk.modules.analogin import AnalogInput
a = AnalogInput(
input: AnalogIn,
filter: Optional(Callable[AnalogIn, int]) = lambda input:input.value>>8,
input: AnalogInput,
filter: Optional(Callable[AnalogInput, int]) = lambda input:input.value>>8,
)

a.value
Expand Down Expand Up @@ -71,7 +71,7 @@ To be used in handler functions.
The analog version of [`Key` objects](keys.md).

```python
from analogin import AnalogEvent
from kmk.modules.analogin import AnalogEvent

AE = AnalogEvent(
on_change: Callable[self, AnalogInput, Keyboard, None] = pass,
Expand Down Expand Up @@ -99,9 +99,9 @@ AK = AnalogKey(
```python
import board
from analogio import AnalogIn
from kmk.modules.analogin import AnalogIn
from kmk.modules.analogin import AnalogInput, AnalogInputs

analog = AnalogIn(
analog = AnalogInputs(
[
AnalogInput(AnalogIn(board.A0)),
AnalogInput(AnalogIn(board.A1)),
Expand Down Expand Up @@ -131,7 +131,7 @@ import board
import busio
import adafruit_mcp4725

from kmk.modules.analogin import AnalogEvent, AnalogInput
from kmk.modules.analogin import AnalogEvent, AnalogInput, AnalogInputs

i2c = busio.I2C(board.SCL, board.SDA)
dac = adafruit_mcp4725.MCP4725(i2c)
Expand All @@ -149,7 +149,7 @@ HTT = AnalogEvent(

a0 = AnalogInput(dac, lambda _: int(_.value / 0xFFFF * 1980) + 20)

analog = AnalogIn(
analog = AnalogInputs(
[a0],
[[HTT]],
```

0 comments on commit 5f1c856

Please sign in to comment.