You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/using-ps3-sixaxis.md
+19-8Lines changed: 19 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,15 @@
1
1
---
2
2
title: Bluetooth PS3 gamepad in Python
3
3
group: hardware-extras
4
-
author: Anton Vanhoucke
4
+
author: "@antonvh"
5
5
---
6
6
7
7
* Table of Contents
8
8
{:toc}
9
9
10
-
The cool thing about the PS3 gamepad is that it's a normal Bluetooth device and connects directly to the Ev3. You can easily run programs in brickman and use the pad without another computer or laptop.
10
+
The cool thing about the PS3 gamepad is that it's a normal Bluetooth device and
11
+
connects directly to the EV3. You can easily run programs in brickman and use
12
+
the pad without another computer or laptop.
11
13
12
14
# What you need
13
15
- A PS3 gamepad (also known as Sixaxis controller or Dualshock 3)
@@ -16,23 +18,31 @@ The cool thing about the PS3 gamepad is that it's a normal Bluetooth device and
16
18
- ev3-ev3dev-jessie-2015-12-30.img or later
17
19
18
20
# Connection
19
-
The PS3 pairing process in Brickman is a little strange, but works fine. Stick exactly to these steps:
21
+
The PS3 pairing process in Brickman is a little strange, but works fine. Stick
22
+
exactly to these steps:
20
23
21
24
1. On the Ev3 brick go to 'Wireless and Networks' > 'Bluetooth'
22
25
2. Make sure Bluetooth is Powered and the brick is Visible.
23
-
3. Connect the gamepad via a mini usb cable to the Ev3. I used the large usb port next to the micro SD slot.
26
+
3. Connect the gamepad via a mini usb cable to the Ev3. I used the large usb
27
+
port next to the micro SD slot.
24
28
4. Under Devices a 'PLAYSTATION(R) 3 controller' should show up. But don't pair!
25
29
4. Remove the USB cable again.
26
30
5. Press the PS3 button on the gamepad.
27
31
6. The brick now asks "Authorize service HID?" Press "Accept"
28
32
29
-
You're done! Whenever you press the PS3 button on the gamepad now, it will try to connect to the ev3 brick. Nice!
33
+
You're done! Whenever you press the PS3 button on the gamepad now, it will try
34
+
to connect to the ev3 brick. Nice!
30
35
31
-
If brickman doesn't work or if you don't have a display, like on a BrickPi, `bluetoothctl` is the way to go. The gentoo linux guys wrote [a nice tutorial](https://wiki.gentoo.org/wiki/Sony_DualShock)
36
+
If brickman doesn't work or if you don't have a display, like on a BrickPi,
37
+
`bluetoothctl` is the way to go. The gentoo linux guys wrote [a nice tutorial](https://wiki.gentoo.org/wiki/Sony_DualShock)
32
38
33
39
34
40
# Running motors with a PS3 sixaxis controller
35
-
Now on to Python. In python we need the evdev (without a 3) to read gamepad events. Here's a quick program that will take the right stick Y axis and use it to set the speed of a motor in port A. Note that motor control is in a separate thread. That's because controlling the motors is much slower than reading the gamepad. Multithreading synchronizes both.
41
+
Now on to Python. In python we need the evdev (without a 3) to read gamepad
42
+
events. Here's a quick program that will take the right stick Y axis and use it
43
+
to set the speed of a motor in port A. Note that motor control is in a separate
44
+
thread. That's because controlling the motors is much slower than reading the
45
+
gamepad. Multithreading synchronizes both.
36
46
37
47
{% highlight python %}
38
48
#!/usr/bin/env python
@@ -98,7 +108,8 @@ for event in gamepad.read_loop(): #this loops infinitely
98
108
break
99
109
{% endhighlight %}
100
110
101
-
Copy this code into a file on the Ev3 brick to run it. If you do `sudo chmod +x your_file_name.py`, you can even run it from the brickman interface!
111
+
Copy this code into a file on the Ev3 brick to run it. If you do
112
+
`sudo chmod +x your_file_name.py`, you can even run it from the brickman interface!
102
113
103
114
# The complete event type and code mapping of the ps3 controller
excerpt: "We have a projects page where users can browse projects that have been built using ev3dev. You can add your own too! Each project gets a dedicated page for the author to explain what they have been working on, as well as provide videos, pictures, build instructions, code, and any other media that pertains to the project."
Copy file name to clipboardExpand all lines: support.md
+22-18Lines changed: 22 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,8 @@ redirect_from: /issues/index.html
4
4
excerpt: "Have a problem or question? We are here to help - but you have to help us help you. We keep track of problems, suggestions and questions about ev3dev using GitHub Issues. This lets us keep everything in one place."
5
5
---
6
6
7
-
* Table of Contents
8
-
{:toc}
7
+
* Table of Contents
8
+
{:toc}
9
9
10
10
<center>
11
11
<h3>Have a problem or question?
@@ -21,12 +21,11 @@ We keep track of problems, suggestions and questions about ev3dev using [GitHub
21
21
Issues]. This lets us keep everything in one place. (So, please don't email the
22
22
developers directly unless you have a personal question.)
23
23
24
-
First, before submitting an issue, search the existing issues (open and closed) to make sure someone else has
25
-
not already reported the same problem or asked the same question. Please only
26
-
comment on an existing **open** issue if you are fairly sure your problem/question is
27
-
*exactly* the same. If the issue is closed or you are not sure your problem is the same,
28
-
open a new issue instead. Be sure to mention any related issue by number and GitHub will
29
-
magically create a link to it (e.g `#100`).
24
+
First, before submitting an issue, search the existing issues (open and closed)
25
+
to make sure someone else has not already reported the same problem or asked the
26
+
same question. Please only comment on an existing **open** issue if you are
27
+
fairly sure your problem/question is *exactly* the same. If the issue is closed
28
+
or you are not sure your problem is the same, open a new issue instead.
30
29
31
30
<br/>
32
31
@@ -40,8 +39,9 @@ magically create a link to it (e.g `#100`).
40
39
</form>
41
40
42
41
<small>
43
-
__Note:__ The [ev3dev-lang]{:target="_blank"} repository has its own
0 commit comments