todi
Posts: 11
Joined: Wed Apr 23, 2014 10:09 pm
Location: Salvador/BA/Brazil
Contact: Website

[QUESTION] SPI and PSP 2-Axis

Sun Jun 01, 2014 7:50 pm

Hello,

So, I'd like to know if anyone has any information about the functionalities of PSP 2-Axis in the Raspberry Pi? I want more detailed information than this site http://www.newsdownload.co.uk/pages/RPi ... stick.html, because I can not find nothing about this usage.

I appreciate your help!

Thank you!

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: [QUESTION] SPI and PSP 2-Axis

Mon Jun 02, 2014 12:26 pm

the 2 axis stick gives an analogue value, the SPI based Digital to analogue converter changes the signal into a digital reference that is taken back to the pi via the SPI bus.

there are many 2 axis sticks that do the same things, I've got three in my bits box waiting for a project that needs them.
Doug.
Building Management Systems Engineer.

todi
Posts: 11
Joined: Wed Apr 23, 2014 10:09 pm
Location: Salvador/BA/Brazil
Contact: Website

Re: [QUESTION] SPI and PSP 2-Axis

Mon Jun 02, 2014 2:10 pm

BMS Doug wrote:the 2 axis stick gives an analogue value, the SPI based Digital to analogue converter changes the signal into a digital reference that is taken back to the pi via the SPI bus.

there are many 2 axis sticks that do the same things, I've got three in my bits box waiting for a project that needs them.
I'm trying to read the bits retrieved from MCP3002 to the R-Pi, but, without success. I'm reproducing the Python code that read the bits to C++, but, I'm not tested it, yet!

I didn't find an example in pure C++, just found examples using the wiringPi, and I don't want to use this lib. :( if you know any examples in C or C++, I'll appreciate the sharing! :D

Thanks!

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: [QUESTION] SPI and PSP 2-Axis

Mon Jun 02, 2014 3:11 pm

halherta has written a nice post about interfacing the MC3008 in C++ it should be fairly easy to modify this to work with the MCP3002.
Doug.
Building Management Systems Engineer.

todi
Posts: 11
Joined: Wed Apr 23, 2014 10:09 pm
Location: Salvador/BA/Brazil
Contact: Website

Re: [QUESTION] SPI and PSP 2-Axis

Mon Jun 02, 2014 4:27 pm

BMS Doug wrote:halherta has written a nice post about interfacing the MC3008 in C++ it should be fairly easy to modify this to work with the MCP3002.
Great! Thank you so much! :D :D :D

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: [QUESTION] SPI and PSP 2-Axis

Tue Jun 03, 2014 7:10 am

todi wrote: Great! Thank you so much! :D :D :D
you are welcome.
Doug.
Building Management Systems Engineer.

todi
Posts: 11
Joined: Wed Apr 23, 2014 10:09 pm
Location: Salvador/BA/Brazil
Contact: Website

Re: [QUESTION] SPI and PSP 2-Axis

Tue Jun 03, 2014 12:52 pm

BMS Doug wrote:
todi wrote: Great! Thank you so much! :D :D :D
you are welcome.
Well, I lied! It's not that ok! :cry:
Yes, it works! I mean... the code created by Adafruit team for Python, I changed to C++ and it work! But, I need to create an coordinate space with the X (channel 1) and Y (channel 0), but, the values of X and Y changes everytime I start my application and I don't know how can I could create this space. Did you know how? Or have any a ideas? :cry:

Thank you again!

Return to “Advanced users”