https://github.com/vincent7128/pi-tank
Raspberry Pi Tank, play with 🎮 PS DualShock, scripts or web on phone.
https://github.com/vincent7128/pi-tank
dualshock2 gpio joystick l293 pi-tank pwm raspberry-pi tamiya
Last synced: 7 months ago
JSON representation
Raspberry Pi Tank, play with 🎮 PS DualShock, scripts or web on phone.
- Host: GitHub
- URL: https://github.com/vincent7128/pi-tank
- Owner: vincent7128
- License: mit
- Created: 2017-12-10T12:54:09.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-12T13:37:20.000Z (about 8 years ago)
- Last Synced: 2025-02-16T17:55:46.030Z (12 months ago)
- Topics: dualshock2, gpio, joystick, l293, pi-tank, pwm, raspberry-pi, tamiya
- Language: JavaScript
- Homepage: https://www.youtube.com/playlist?list=PLcIrg1WCmBl7it3Tyw8yWZ0FtsL5A7frw
- Size: 263 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Pi Tank
======
Raspberry Pi Tank, play on computer or phone, also can play with PS DualShock or scripts.
[📺 Web Demo On Youtube](https://youtu.be/AcS-mvNuP6E)
[📺 Joystick Demo On Youtube](https://youtu.be/4AIHV-h934w)
[📺 Script Demo On Youtube](https://youtu.be/czwEzWJb0UM)
# Install
```
# sudo npm install -g pi-tank
```
## Play with web
```
$ sudo pi-tank-web [port-number: default 8080]
```
*** Open http://[your-RaspberryPi-ip]:[port-number] ***
## Play with usb joystick
```
$ sudo pi-tank-joystick [USB-joystick-id: default 0]
```
## Play with script
#### Create play.json
```
[{
"rule": function () {
this.break();
}
},
{
"rule": function () {
this.speed(100);
},
"time": 3000
},
{
"rule": function () {
this.direction(90);
},
"time": 3000
},
{
"rule": function () {
this.direction(-90);
},
"time": 3000
},
{
"rule": function () {
this.direction(180);
},
"time": 3000
},
{
"rule": function () {
this.off();
}
}]
```
#### Run script
```
$ sudo pi-tank-play play.json
```
# L293 default wiring

# License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details