Skip to content

Commit 842ceda

Browse files
committed
docs(wokwi-analog-joystick): document automation controls
1 parent ede1c91 commit 842ceda

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/parts/wokwi-analog-joystick.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ You can use the [map() function](https://www.arduino.cc/reference/en/language/fu
9595
For instance, `map(analogRead(HORZ_PIN), 0, 1023, -100, 100)` will return -100 when the joystick is all the way to the right, 0 when the joystick
9696
in centered, and 100 when the joystick is all the way to the left.
9797

98+
## Automation controls
99+
100+
The joystick can be controlled using [Automation Scenarios](../wokwi-ci/automation-scenarios). It exposes the following controls:
101+
102+
| Control | Type | Description |
103+
|---------|-------|----------------------------------------------------------|
104+
| x | float | Set the x value of the joystick (-1 to 1, 0 is centered) |
105+
| y | float | Set the y value of the joystick (-1 to 1, 0 is centered) |
106+
| pressed | int | Set to 1 to press the button, 0 to release it. |
107+
98108
## Simulator examples
99109

100110
- [Etch-a-sketch](https://wokwi.com/projects/296234816685212169) - A simple drawing game using a MAX7219 LED Dot Matrix

0 commit comments

Comments
 (0)