Joystick for pspi
 
Notifications
Clear all

Joystick for pspi

5 Posts
3 Users
0 Likes
1,279 Views
(@tdragovich6)
New Member
Joined: 8 years ago
Posts: 2
Topic starter  

The 2001 psp accepts 1.3v as vcc. Is it not possible to use a voltage divider to bring vcc down from 3.3v or 5v and then use the mid value +-5 as center point for each axis?


   
Quote
(@othermod)
Reputable Member Admin
Joined: 8 years ago
Posts: 359
 

That's exactly what I did on the simple joystick circuit. The joystick is just 2 variable resistors, so they will divide any voltage you put on them. If you put 5v then the center point will be around 2.5v, and if you put 3.3v then the center point will be around 1.65v.

You can put any voltage you want on the joystick input and it will divide it.


   
ReplyQuote
(@tdragovich)
Active Member
Joined: 8 years ago
Posts: 5
 

 This is all a question here so please bear with me. 

But my point is why use the comparator? Am I wrong that the pi can accept an analog input? Lets say the resistance of the entire x axis is 10k. Then the mid point would be at 5k. if the voltage expected on the gpio is 3.3v and the vcc is 1.3v (approx half) then a ratio value would be 3.3v/255:1.3v/100.455est. then the mid point value of the x axis should have a reading of around 50.23. Could we not set a variable say xValue = read(gpioPin)? Then determine if it needs to increase or decrease speed by the amount of change?

I am not sure of the actual syntax here so sorry. I have been out of the programming loop for awhile now.


   
ReplyQuote
(@tdragovich6)
New Member
Joined: 8 years ago
Posts: 2
Topic starter  

BTW I did purchase the joystick board. I am just trying to find a way to utilise the analog joystick as such. Some of the games I have playef in the past have a run/walk capability and would need the analog input to determine how fast.


   
ReplyQuote
(@othermod)
Reputable Member Admin
Joined: 8 years ago
Posts: 359
 

I understand now. No, the pi does not have analog input. The GPIO is either off or on, nothing in-between. The only option to get true analog is an analog to digital converter that has proper drivers for the Pi. I'm working on a solution for it using a relatively cheap ADC, but it's going to take some time. 


   
ReplyQuote