Questions tagged [joystick]
48 questions
4
votes
2 answers
Interfacing Logitech Joystick to Arduino and interrupt a while loop
I am working on a project of a robot arm. The joints are made of servo motor. The basic function can be describe as:
The robot arm (the servos) were moved manually by the Logitech joystick.
The user could press a certain button to remember a…
John Keane
- 41
- 1
2
votes
1 answer
How can I compensate for a joysticks offset value in neutral position?
I have a joystick that outputs the values 0 - 4095. I want to map these values in this fashion (Yes, the reversed mapping is intended):
outputValue = map(inputValue, 4095, 0, -2048, 2047);
However, the neutral central position of the joystick is…
Erik
- 271
- 1
- 15
2
votes
0 answers
I am trying to control 4 servos with a joystick, but after a few seconds, they start spinning and don't stop until the power source is cut
Here's my code. I don't know if the issue is the power source though. I only have access to my computer for a power source.
#include
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
int joyX = A2;
int joyY = A5;
int Joyx =…
PokemonsterBlue2
- 21
- 2
2
votes
1 answer
How to use a USB host shield with different HID Joysticks
I bought a Sparkfun USB host shield a while ago and have been using it using my Logitech Extreme 3D Pro Joystick. There is some example code for that one which makes it nice and easy to work with. There is also some example code for a generic USB…
Vosem Media
- 110
- 8
2
votes
1 answer
Servos not working properly with joystick
So, I was working with a project in which I used a joystick module to control two servos at the same time. The joystick controls the servos in a way that when the joystick is moved along x-axis, both servos move in the same direction but when…
Faiq Irfan
- 129
- 1
- 7
1
vote
2 answers
Expose two HID Joystick devices with single RP2040 board (Waveshare Pi Pico Zero)
I want to use a Waveshare Pi Pico Zero to connect two standard NES controllers to a computer over a single USB port.
I'm using the Waveshare RP2040 Zero board definition from https://github.com/earlephilhower/arduino-pico which seems to provide a…
NeilenMarais
- 219
- 3
- 8
1
vote
0 answers
ESP32 WROOM32E w/ Arduino IDE 2axis joystick - how do I get a good reading?
How do I get the full range of motion from an analog joystick and the ESP32 WROOM32E using the Arduino IDE with esp-idf installed?
Using a 2 axis analog joystick, the 5v/3.3v pin, ground pin and the following code. I do not get the correct results…
localmartian
- 21
- 4
1
vote
0 answers
I'm getting really unstable analog values with my B103348 joystick
I'm trying to make my B103348 joystick control a DC motor but I'm getting very unstable values from it specifically when the y axis is at 0. This is what my Serial monitor shows...
0,
21,
21,
21,
0,
22,
23,
21,
21...
This is the wiring...
And…
Christian Bautch
- 21
- 1
- 3
1
vote
1 answer
Can Arduino UNO be used to emulate a PS4 joystick?
I Want to know if there is a library that can be used in order to make a PS4 controller with Arduino.
I have a PS2 steering wheel and I want to use it thorugh Arduino with PS4. I know that PS4 has his own protocol but I think there may be a way to…
AlexSp3
- 203
- 1
- 8
1
vote
2 answers
Im trying to map a joystick to a servo but need the servo to be at 0 when the joystick is in nerural. And up to 180 when joy is forward or back
Im trying to map a joystick to a servo but need the servo to be at 0 when the joystick is in nerural. And up to +180 when joy is forward or back.
I just cant seem to figure out the mapping or setup for the code for this part.
I remember seeing it…
hendr13x
- 11
- 3
1
vote
0 answers
How can I control 2 servos separately using a joystick on an ATTiny85?
Prelude
I haven't done a lot of work in programming chips. The ATTiny85 is the first chip I've programmed, and I have the hang of the basics I think, but I don't have an in-depth understanding of it's capabilities and how to perform complex circuits…
Devin Carpenter
- 111
- 2
1
vote
0 answers
I'm making a trim wheel using a rotary encoder for flight simulation. Should I have the Joystick library use button presses or make it an axis?
Title says the majority of it. I'm looking to make a trim wheel for flight sim using a rotary encoder, the Joystick library and an Arduino Leonardo. I wasn't sure if it would be better to make it a button press or have it be an axis, possibly the…
Pierce Jennings
- 11
- 1
1
vote
0 answers
Custom PS4 joystick with arduino
I am acquiring a Logitech G29 for my PS4 and I want to have an external handbreak. The handbrake only needs an input when active, so no "pressure level" or something like that required, only "on" or "off".
I have come around a few answers such as…
1
vote
0 answers
DHT11 thermometer connected to a LCD and 2 servos connected to joysrick
Im trying to find a way to run two codes from the one arduino me being an absolute begginer doesnt even know where to start the DHT11 thermometer is connected to a LCD showing temperature and humidity and uses a "DHTlib" library whereas the joystick…
Daniel o dea
- 11
- 1
1
vote
1 answer
How can I PWM 4 LEDs from 0 to full brightness using a two axiz resistive joystick?
I am trying to use the Arduino MAP function to allow me to PWM 4 LEDs between 0 and full brightness. I guess the tricky part is that the joystick neutral position is at the venter of the range of the potentiometers so the analog voltage to the…
Tokthebloke
- 11
- 2